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

推荐订阅源

G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
雷峰网
雷峰网
博客园_首页
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
小众软件
小众软件
D
Docker
P
Proofpoint News Feed
B
Blog
Vercel News
Vercel News
B
Blog RSS Feed
U
Unit 42
月光博客
月光博客
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
I
InfoQ
Recent Announcements
Recent Announcements

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): reject malformed realtime consult calls · o...
khoek · 2026-06-16 · via Recent Commits to openclaw:main

File tree

  • extensions/discord/src/voice

Original file line numberDiff line numberDiff line change

@@ -2390,6 +2390,49 @@ describe("DiscordVoiceManager", () => {

23902390

);

23912391

});

23922392
2393+

it("rejects malformed realtime consult tool calls without crashing Discord voice", async () => {

2394+

const manager = createManager({

2395+

groupPolicy: "open",

2396+

voice: {

2397+

enabled: true,

2398+

mode: "agent-proxy",

2399+

realtime: { provider: "openai" },

2400+

},

2401+

});

2402+
2403+

await manager.join({ guildId: "g1", channelId: "1001" });

2404+

const bridgeParams = lastRealtimeBridgeParams() as

2405+

| {

2406+

onToolCall?: (

2407+

event: {

2408+

itemId: string;

2409+

callId: string;

2410+

name: string;

2411+

args: unknown;

2412+

},

2413+

session: typeof realtimeSessionMock,

2414+

) => void;

2415+

}

2416+

| undefined;

2417+
2418+

expect(() =>

2419+

bridgeParams?.onToolCall?.(

2420+

{

2421+

itemId: "item-empty-consult",

2422+

callId: "call-empty-consult",

2423+

name: "openclaw_agent_consult",

2424+

args: {},

2425+

},

2426+

realtimeSessionMock,

2427+

),

2428+

).not.toThrow();

2429+
2430+

expect(agentCommandMock).not.toHaveBeenCalled();

2431+

expect(realtimeSessionMock.submitToolResult).toHaveBeenCalledWith("call-empty-consult", {

2432+

error: "question required",

2433+

});

2434+

});

2435+
23932436

it("does not require speaker context for internal exact-speech consults", async () => {

23942437

const manager = createManager({

23952438

groupPolicy: "open",

Original file line numberDiff line numberDiff line change

@@ -1124,7 +1124,17 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

11241124

session.submitToolResult(callId, { text: exactSpeechText });

11251125

return;

11261126

}

1127-

const consultMessage = buildRealtimeVoiceAgentConsultChatMessage(event.args);

1127+

let consultMessage: string;

1128+

try {

1129+

consultMessage = buildRealtimeVoiceAgentConsultChatMessage(event.args);

1130+

} catch (error) {

1131+

const message = formatErrorMessage(error);

1132+

logger.warn(

1133+

`discord voice: realtime consult rejected malformed args call=${callId || "unknown"}: ${message}`,

1134+

);

1135+

session.submitToolResult(callId, { error: message });

1136+

return;

1137+

}

11281138

logger.info(

11291139

`discord voice: realtime consult requested call=${callId || "unknown"} voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId} question=${formatRealtimeLogPreview(consultMessage)}`,

11301140

);