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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
IT之家
IT之家
C
Check Point Blog
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
美团技术团队
M
MIT News - Artificial intelligence
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
F
Fortinet All Blogs
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)

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: gate discord realtime voice by wake name (#85915) · ...
steipete · 2026-05-24 · via Recent Commits to openclaw:main

@@ -2431,6 +2431,149 @@ describe("DiscordVoiceManager", () => {

24312431

expectUserMessageIncludes("normal answer");

24322432

});

243324332434+

it("requires the agent wake name before realtime agent-proxy consults", async () => {

2435+

agentCommandMock.mockResolvedValueOnce({ payloads: [{ text: "wake answer" }] });

2436+

const manager = createManager(

2437+

{

2438+

groupPolicy: "open",

2439+

voice: {

2440+

enabled: true,

2441+

mode: "agent-proxy",

2442+

realtime: { provider: "openai", consultPolicy: "auto", requireWakeName: true },

2443+

},

2444+

},

2445+

undefined,

2446+

{

2447+

agents: {

2448+

list: [{ id: "agent-1", identity: { name: "Molty" } }],

2449+

},

2450+

},

2451+

);

2452+2453+

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

2454+

const entry = getSessionEntry(manager) as {

2455+

realtime?: {

2456+

beginSpeakerTurn: (

2457+

context: { extraSystemPrompt?: string; senderIsOwner: boolean; speakerLabel: string },

2458+

userId: string,

2459+

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

2460+

};

2461+

};

2462+

const bridgeParams = lastRealtimeBridgeParams() as

2463+

| {

2464+

audioSink?: { sendAudio: (audio: Buffer) => void };

2465+

autoRespondToAudio?: boolean;

2466+

interruptResponseOnInputAudio?: boolean;

2467+

onTranscript?: (role: "user" | "assistant", text: string, isFinal: boolean) => void;

2468+

}

2469+

| undefined;

2470+2471+

expect(bridgeParams?.autoRespondToAudio).toBe(false);

2472+

expect(bridgeParams?.interruptResponseOnInputAudio).toBe(false);

2473+

bridgeParams?.audioSink?.sendAudio(Buffer.alloc(48_000));

2474+2475+

const guestTurn = entry.realtime?.beginSpeakerTurn(

2476+

{ extraSystemPrompt: undefined, senderIsOwner: false, speakerLabel: "Guest" },

2477+

"u-guest",

2478+

);

2479+

guestTurn?.sendInputAudio(Buffer.alloc(8));

2480+

bridgeParams?.onTranscript?.("user", "agent-1 status of PR 123", true);

2481+

await new Promise((resolve) => setTimeout(resolve, 260));

2482+2483+

expect(controlRealtimeVoiceAgentRunMock).not.toHaveBeenCalled();

2484+

expect(agentCommandMock).not.toHaveBeenCalled();

2485+

expect(realtimeSessionMock.handleBargeIn).not.toHaveBeenCalled();

2486+2487+

const ownerTurn = entry.realtime?.beginSpeakerTurn(

2488+

{ extraSystemPrompt: undefined, senderIsOwner: true, speakerLabel: "Owner" },

2489+

"u-owner",

2490+

);

2491+

ownerTurn?.sendInputAudio(Buffer.alloc(8));

2492+

bridgeParams?.onTranscript?.("user", "Hey, Molty, status of PR 123", true);

2493+

await new Promise((resolve) => setTimeout(resolve, 260));

2494+2495+

expect(controlRealtimeVoiceAgentRunMock).toHaveBeenCalledWith({

2496+

sessionKey: "discord:g1:c1",

2497+

text: "status of PR 123",

2498+

});

2499+

expect(lastAgentCommandArgs().message).toContain("status of PR 123");

2500+

expect(lastAgentCommandArgs().message).not.toContain("Molty");

2501+

expect(lastAgentCommandArgs().message).not.toContain("Hey");

2502+

expect(lastAgentCommandArgs().userId).toBe("u-owner");

2503+

expectUserMessageIncludes("wake answer");

2504+

});

2505+2506+

it("leaves non-OpenAI agent-proxy realtime auto-response enabled when wake names are requested", async () => {

2507+

resolveConfiguredRealtimeVoiceProviderMock.mockReturnValueOnce({

2508+

provider: { id: "google" },

2509+

providerConfig: { model: "gemini-live", voice: "default" },

2510+

});

2511+

const manager = createManager({

2512+

groupPolicy: "open",

2513+

voice: {

2514+

enabled: true,

2515+

mode: "agent-proxy",

2516+

realtime: { provider: "google", consultPolicy: "auto", requireWakeName: true },

2517+

},

2518+

});

2519+2520+

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

2521+

const bridgeParams = lastRealtimeBridgeParams() as

2522+

| {

2523+

autoRespondToAudio?: boolean;

2524+

interruptResponseOnInputAudio?: boolean;

2525+

}

2526+

| undefined;

2527+2528+

expect(bridgeParams?.autoRespondToAudio).toBe(true);

2529+

expect(bridgeParams?.interruptResponseOnInputAudio).toBe(true);

2530+

});

2531+2532+

it("uses configured wake names before realtime agent-proxy consults", async () => {

2533+

agentCommandMock.mockResolvedValueOnce({ payloads: [{ text: "configured wake answer" }] });

2534+

const manager = createManager({

2535+

groupPolicy: "open",

2536+

voice: {

2537+

enabled: true,

2538+

mode: "agent-proxy",

2539+

realtime: {

2540+

provider: "openai",

2541+

consultPolicy: "auto",

2542+

requireWakeName: true,

2543+

wakeNames: ["Claw", "Claw Bot"],

2544+

},

2545+

},

2546+

});

2547+2548+

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

2549+

const entry = getSessionEntry(manager) as {

2550+

realtime?: {

2551+

beginSpeakerTurn: (

2552+

context: { extraSystemPrompt?: string; senderIsOwner: boolean; speakerLabel: string },

2553+

userId: string,

2554+

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

2555+

};

2556+

};

2557+

const turn = entry.realtime?.beginSpeakerTurn(

2558+

{ extraSystemPrompt: undefined, senderIsOwner: true, speakerLabel: "Owner" },

2559+

"u-owner",

2560+

);

2561+

turn?.sendInputAudio(Buffer.alloc(8));

2562+

const bridgeParams = lastRealtimeBridgeParams() as

2563+

| {

2564+

onTranscript?: (role: "user" | "assistant", text: string, isFinal: boolean) => void;

2565+

}

2566+

| undefined;

2567+2568+

bridgeParams?.onTranscript?.("user", "Claw Bot, ship it", true);

2569+

await new Promise((resolve) => setTimeout(resolve, 260));

2570+2571+

expect(lastAgentCommandArgs().message).toContain("ship it");

2572+

expect(lastAgentCommandArgs().message).not.toContain("Claw");

2573+

expect(lastAgentCommandArgs().message).not.toContain("Bot");

2574+

expectUserMessageIncludes("configured wake answer");

2575+

});

2576+24342577

it("lets status questions fall back to normal realtime handling when no run is active", async () => {

24352578

agentCommandMock.mockResolvedValueOnce({ payloads: [{ text: "status answer" }] });

24362579

controlRealtimeVoiceAgentRunMock.mockResolvedValueOnce({

@@ -3319,6 +3462,7 @@ describe("DiscordVoiceManager", () => {

33193462

voice: "cedar",

33203463

toolPolicy: "safe-read-only",

33213464

consultPolicy: "always",

3465+

requireWakeName: true,

33223466

providers: {

33233467

openai: {

33243468

interruptResponseOnInputAudio: false,