fix: accept OpenClaw voice wake confusions (#86507) · openclaw/openclaw@b077c3a
steipete
·
2026-05-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,7 @@ Docs: https://docs.openclaw.ai
|
15 | 15 | ### Fixes |
16 | 16 | |
17 | 17 | - Gateway: avoid sending duplicate tool-event frames to Control UI connections that are subscribed by both run and session. |
| 18 | +- Discord/OpenAI voice: accept longer leading wake-name mistranscripts such as "Open Club" for OpenClaw. |
18 | 19 | - Discord/OpenAI voice: accept leading fuzzy wake-name transcripts such as "Monty" or "Moti" for a Molty agent while keeping ambient speech gated. |
19 | 20 | - Media understanding: convert HEIC and HEIF images to JPEG before image description providers run so iPhone photos work in direct and configured image-description flows. (#86037) |
20 | 21 | - Discord/OpenAI voice: rotate Realtime sessions at provider max duration without logging the expected session-expiry event as an error. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3031,6 +3031,27 @@ describe("DiscordVoiceManager", () => {
|
3031 | 3031 | |
3032 | 3032 | expect(agentCommandArgsAt(2).message).toContain("can you still hear me?"); |
3033 | 3033 | expect(agentCommandArgsAt(2).message).not.toContain("Open claw"); |
| 3034 | + |
| 3035 | +const openClubTurn = entry.realtime?.beginSpeakerTurn( |
| 3036 | +{ extraSystemPrompt: undefined, senderIsOwner: true, speakerLabel: "Owner" }, |
| 3037 | +"u-owner", |
| 3038 | +); |
| 3039 | +openClubTurn?.sendInputAudio(Buffer.alloc(8)); |
| 3040 | +bridgeParams?.onTranscript?.("user", "Open Club, can you hear me now?", true); |
| 3041 | +await new Promise((resolve) => setTimeout(resolve, 260)); |
| 3042 | + |
| 3043 | +expect(agentCommandArgsAt(3).message).toContain("can you hear me now?"); |
| 3044 | +expect(agentCommandArgsAt(3).message).not.toContain("Open Club"); |
| 3045 | + |
| 3046 | +const openChatTurn = entry.realtime?.beginSpeakerTurn( |
| 3047 | +{ extraSystemPrompt: undefined, senderIsOwner: true, speakerLabel: "Owner" }, |
| 3048 | +"u-owner", |
| 3049 | +); |
| 3050 | +openChatTurn?.sendInputAudio(Buffer.alloc(8)); |
| 3051 | +bridgeParams?.onTranscript?.("user", "Open chat, can you hear me now?", true); |
| 3052 | +await new Promise((resolve) => setTimeout(resolve, 260)); |
| 3053 | + |
| 3054 | +expect(agentCommandMock).toHaveBeenCalledTimes(4); |
3034 | 3055 | }); |
3035 | 3056 | |
3036 | 3057 | it("rejects non-wake fuzzy leading phrases before realtime agent-proxy consults", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -70,6 +70,9 @@ const DISCORD_RAW_PCM_FRAME_BYTES = 3_840;
|
70 | 70 | const DISCORD_REALTIME_OUTPUT_PREROLL_FRAMES = 25; |
71 | 71 | const DISCORD_REALTIME_TRAILING_SILENCE_MIN_MS = 700; |
72 | 72 | const DISCORD_REALTIME_TRAILING_SILENCE_MAX_MS = 3_000; |
| 73 | +const DISCORD_REALTIME_WAKE_NAME_CONFUSIONS = new Map<string, ReadonlySet<string>>([ |
| 74 | +["openclaw", new Set(["openclub", "opencloud"])], |
| 75 | +]); |
73 | 76 | const DISCORD_REALTIME_FORCED_CONSULT_TRAILING_FRAGMENT_WORDS = new Set([ |
74 | 77 | "a", |
75 | 78 | "about", |
@@ -492,7 +495,10 @@ function isFuzzyWakeNameMatch(candidate: LeadingWakeNameCandidate, wakeName: str
|
492 | 495 | if (distance <= 1) { |
493 | 496 | return true; |
494 | 497 | } |
495 | | -return distance === 2 && wakeCompact.length >= 5 && heardCompact.length !== wakeCompact.length; |
| 498 | +if (distance === 2 && wakeCompact.length >= 5 && heardCompact.length !== wakeCompact.length) { |
| 499 | +return true; |
| 500 | +} |
| 501 | +return DISCORD_REALTIME_WAKE_NAME_CONFUSIONS.get(wakeCompact)?.has(heardCompact) === true; |
496 | 502 | } |
497 | 503 | |
498 | 504 | function stripLeadingWakeNameCandidate(text: string, candidate: LeadingWakeNameCandidate): string { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。