惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
小众软件
小众软件
GbyAI
GbyAI
B
Blog RSS Feed
月光博客
月光博客
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
博客园_首页
G
Google Developers Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(discord): harden read message results (#82276) · open...
steipete · 2026-05-16 · via Recent Commits to openclaw:main

File tree

  • extensions/discord/src/actions

Original file line numberDiff line numberDiff line change

@@ -18,6 +18,7 @@ Docs: https://docs.openclaw.ai

1818

- Plugin releases: require external package compatibility metadata in the npm plugin publish plan, matching the ClawHub package contract before packages ship.

1919

- Agents/OpenAI-compatible: honor per-model `max_completion_tokens`/`max_tokens` params in embedded OpenAI-completions runs so high-token Kimi-style routes keep their configured completion cap. Fixes #82230. Thanks @albert-zen.

2020

- Agents/local: install a local gateway request scope around trusted `openclaw agent --local` runs, so subagent completion announces can use in-process gateway dispatch without crashing. Fixes #82140. Thanks @Kushmaro.

21+

- Discord: validate message-read results before normalizing channel history and report unexpected payloads with a Discord boundary error instead of `map is not a function`. Fixes #82252. Thanks @jessewunderlich.

2122

- Telegram/active-memory: run blocking memory recall through the Telegram provider for direct-message turns even when the hook context carries the raw chat id, preventing embedded recall from launching against an invalid numeric channel. Fixes #82177. Thanks @cslash-zz.

2223

- Control UI/WebChat: keep optimistic image messages from embedding large inline `data:` previews and preserve image-only user turns in chat history, avoiding browser stack overflows when sending image attachments. Fixes #82182. Thanks @ExploreSheep.

2324

- Agents/media: preserve message-tool-only delivery for generated music and video completion handoffs, so group/channel completions do not finish without posting the generated attachment.

Original file line numberDiff line numberDiff line change

@@ -24,6 +24,29 @@ function parseDiscordMessageLink(link: string) {

2424

};

2525

}

2626
27+

function describeDiscordMessageListResult(value: unknown): string {

28+

if (Array.isArray(value)) {

29+

return "array";

30+

}

31+

if (value === null) {

32+

return "null";

33+

}

34+

if (value && typeof value === "object") {

35+

const keys = Object.keys(value).toSorted();

36+

return keys.length ? `object with keys ${keys.join(", ")}` : "object";

37+

}

38+

return typeof value;

39+

}

40+
41+

function assertDiscordMessageListResult(value: unknown): Array<unknown> {

42+

if (Array.isArray(value)) {

43+

return value;

44+

}

45+

throw new Error(

46+

`Discord message read returned ${describeDiscordMessageListResult(value)} instead of an array.`,

47+

);

48+

}

49+
2750

export async function handleDiscordMessageManagementAction(ctx: DiscordMessagingActionContext) {

2851

switch (ctx.action) {

2952

case "permissions": {

@@ -80,10 +103,8 @@ export async function handleDiscordMessageManagementAction(ctx: DiscordMessaging

80103

after: readStringParam(ctx.params, "after"),

81104

around: readStringParam(ctx.params, "around"),

82105

};

83-

const messages = await discordMessagingActionRuntime.readMessagesDiscord(

84-

channelId,

85-

query,

86-

ctx.withOpts(),

106+

const messages = assertDiscordMessageListResult(

107+

await discordMessagingActionRuntime.readMessagesDiscord(channelId, query, ctx.withOpts()),

87108

);

88109

return jsonResult({

89110

ok: true,

Original file line numberDiff line numberDiff line change

@@ -389,6 +389,14 @@ describe("handleDiscordMessagingAction", () => {

389389

expect(payload.messages[0].timestampUtc).toBe(new Date(expectedMs).toISOString());

390390

});

391391
392+

it("rejects unexpected readMessages payloads with a boundary error", async () => {

393+

readMessagesDiscord.mockResolvedValueOnce({ ok: true } as never);

394+
395+

await expect(

396+

handleMessagingAction("readMessages", { channelId: "C1" }, enableAllActions),

397+

).rejects.toThrow("Discord message read returned object with keys ok instead of an array.");

398+

});

399+
392400

it("threads provided cfg into readMessages calls", async () => {

393401

const cfg = {

394402

channels: {