Skip to content

fix: accept leading fuzzy Discord voice wake names#86484

Merged
steipete merged 1 commit into
mainfrom
fix/discord-leading-fuzzy-wake-name
May 25, 2026
Merged

fix: accept leading fuzzy Discord voice wake names#86484
steipete merged 1 commit into
mainfrom
fix/discord-leading-fuzzy-wake-name

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Add leading-only fuzzy wake-name matching for Discord OpenAI realtime voice when requireWakeName is enabled.
  • Keep existing exact wake-name behavior, but accept ASR variants such as Monty and Moti for a Molty wake name only at the start of an utterance.
  • Require a punctuation/end boundary for fuzzy edit-distance matches so ambient phrases such as Open law is... or Multi, ... stay gated.

Verification

  • pnpm test extensions/discord/src/voice/manager.e2e.test.ts -- --reporter=verbose
  • env -u OPENCLAW_TESTBOX pnpm check:changed
  • .agents/skills/autoreview/scripts/autoreview --mode local

Real behavior proof

Behavior addressed: Discord OpenAI realtime voice wake-name gating now accepts leading ASR variants for the routed agent name without requiring config aliases.
Real environment tested: local OpenClaw source checkout with Discord voice manager E2E tests and changed extension checks.
Exact steps or command run after this patch: pnpm test extensions/discord/src/voice/manager.e2e.test.ts -- --reporter=verbose; env -u OPENCLAW_TESTBOX pnpm check:changed; .agents/skills/autoreview/scripts/autoreview --mode local.
Evidence after fix: the Discord voice E2E suite passes 113 tests, including new coverage for Monty, Moti, Open claw, Multi, ..., and Open law is... wake-gate behavior.
Observed result after fix: leading fuzzy wake phrases are stripped before agent consults; non-wake and ambient leading phrases do not call the agent.
What was not tested: live Discord voice audio against the remote gateway was not rerun for this PR; tmux inspection before the patch showed the failing transcripts and exact OpenClaw success path.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: M maintainer Maintainer-authored PR labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 25, 2026, 8:54 AM ET / 12:54 UTC.

Summary
The PR broadens Discord OpenAI realtime voice requireWakeName matching to accept leading fuzzy wake-name transcripts, adds Discord voice E2E coverage, and updates the changelog.

PR surface: Source +157, Tests +127, Docs +1. Total +285 across 3 files.

Reproducibility: yes. From the patch source, a transcript like Mostly, step through the queue has a strong punctuation boundary and a compact edit distance of 2 from Molty, so it can be reproduced by adding that case beside the new Discord voice E2E wake-gate tests.

Review metrics: 2 noteworthy metrics.

  • Changed files: 3 files: 1 runtime, 1 E2E test, 1 changelog. The PR is focused, but it changes a user-visible Discord voice gate and therefore needs both regression and behavior proof.
  • Wake-gate behavior: 1 existing requireWakeName gate broadened. Existing Discord voice users with the setting enabled may see different routing behavior after upgrade.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Tighten the fuzzy distance-two rule and add a regression for Mostly, ... staying gated for a Molty wake name.
  • Add redacted live Discord voice proof or logs showing the accepted fuzzy wake and rejected ambient-speech paths.

Proof guidance:
Needs real behavior proof before merge: The PR body reports local E2E tests and changed checks, but no redacted live Discord voice output, logs, recording, or linked artifact showing the after-fix behavior; update the PR body with proof to trigger re-review.

Mantis proof suggestion
A short real Discord voice proof would materially improve confidence for the ASR wake-name path and ambient-speech gate. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: capture redacted Discord voice proof that "Monty" wakes Molty while "Mostly" stays gated.

Risk before merge

  • Existing requireWakeName users could get unsolicited Discord voice consults because the distance-two rule accepts longer common words such as “Mostly,” as a fuzzy Molty wake.
  • The proof in the PR body is local E2E/check output only; no live Discord voice artifact shows the after-fix ASR behavior or the ambient-speech rejection path.

Maintainer options:

  1. Tighten fuzzy matching before merge (recommended)
    Constrain the distance-two path so common longer ambient words such as “Mostly,” do not satisfy a Molty wake name, while preserving the intended Monty and Moti cases with regression coverage.
  2. Accept broader wake sensitivity intentionally
    Maintainers could choose to accept the wider fuzzy wake behavior, but that should be an explicit Discord voice product decision because it weakens an existing gate for configured users.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Constrain Discord fuzzy wake matching so distance-two matches do not accept longer common words such as `Mostly` for `Molty`; add E2E coverage that rejects `Mostly, ...` while preserving `Monty`, `Moti`, `Open claw`, `Multi, ...`, and `Open law is...` behavior.

Next step before merge
The remaining blocker is a narrow matcher/test repair that an automated PR repair lane can attempt, while live proof and protected-label handling remain merge gates.

Security
Cleared: The diff does not touch dependencies, workflows, credentials, package metadata, or other supply-chain surfaces; the false-wake concern is tracked as a functional routing risk.

Review findings

  • [P1] Reject longer distance-two false wakes — extensions/discord/src/voice/realtime.ts:495
Review details

Best possible solution:

Keep the fuzzy wake-name behavior, but tighten the distance-two case and add a regression for common ambient false positives before merging with live Discord voice proof.

Do we have a high-confidence way to reproduce the issue?

Yes. From the patch source, a transcript like Mostly, step through the queue has a strong punctuation boundary and a compact edit distance of 2 from Molty, so it can be reproduced by adding that case beside the new Discord voice E2E wake-gate tests.

Is this the best way to solve the issue?

No, not as currently written. The owner path is right, but the fuzzy threshold needs to preserve the wake gate for common ambient words while still accepting the intended ASR variants.

Full review comments:

  • [P1] Reject longer distance-two false wakes — extensions/discord/src/voice/realtime.ts:495
    This accepts any distance-two candidate whose compact length differs from the wake name. For a Molty wake name, Mostly, ... is distance 2 and has the required punctuation boundary, so an ordinary ambient opener would pass requireWakeName and be sent to the agent. Please tighten this path and add a regression next to the Multi and Open law cases.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against fcf0bff92965.

Label changes

Label changes:

  • add P2: This is a bounded Discord voice wake-name improvement with user-visible impact but not an emergency runtime outage.
  • add merge-risk: 🚨 compatibility: The PR changes the behavior of existing voice.realtime.requireWakeName setups by broadening what counts as a wake phrase.
  • add merge-risk: 🚨 message-delivery: A false fuzzy wake can route ambient Discord voice transcripts into an agent consult and produce an unintended voice response.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports local E2E tests and changed checks, but no redacted live Discord voice output, logs, recording, or linked artifact showing the after-fix behavior; update the PR body with proof to trigger re-review.

Label justifications:

  • P2: This is a bounded Discord voice wake-name improvement with user-visible impact but not an emergency runtime outage.
  • merge-risk: 🚨 compatibility: The PR changes the behavior of existing voice.realtime.requireWakeName setups by broadening what counts as a wake phrase.
  • merge-risk: 🚨 message-delivery: A false fuzzy wake can route ambient Discord voice transcripts into an agent consult and produce an unintended voice response.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports local E2E tests and changed checks, but no redacted live Discord voice output, logs, recording, or linked artifact showing the after-fix behavior; update the PR body with proof to trigger re-review.
Evidence reviewed

PR surface:

Source +157, Tests +127, Docs +1. Total +285 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 160 3 +157
Tests 1 127 0 +127
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 288 3 +285

Acceptance criteria:

  • node scripts/run-vitest.mjs extensions/discord/src/voice/manager.e2e.test.ts -- --reporter=verbose
  • .agents/skills/autoreview/scripts/autoreview --mode local
  • Redacted live Discord voice proof or maintainer-approved Mantis proof showing accepted Monty/Moti and rejected Mostly/ambient speech

What I checked:

Likely related people:

  • steipete: GitHub history shows steipete authored and merged the wake-name gate in 17dcdea, then made adjacent Discord realtime voice fixes including fdfcb07, dc2c4aa, and this PR head. (role: recent area contributor and wake-gate feature owner; confidence: high; commits: 17dcdead00f3, fdfcb0795a26, dc2c4aab6d69; files: extensions/discord/src/voice/realtime.ts, extensions/discord/src/voice/manager.e2e.test.ts)
  • fuller-stack-dev: Recent commits by this author touched Discord realtime voice consult and bootstrap behavior near the same forced-consult path. (role: recent adjacent contributor; confidence: medium; commits: f603fa58fec7, 48a14e41e233; files: extensions/discord/src/voice/realtime.ts, extensions/discord/src/voice/manager.e2e.test.ts)
  • Solvely-Colin: Recent Discord realtime voice playback stability work touched the same runtime surface, though not the wake-name gate directly. (role: adjacent stability contributor; confidence: low; commits: 6e8029407919; files: extensions/discord/src/voice/realtime.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5aa284b6d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +491 to +495
const distance = levenshteinDistance(heardCompact, wakeCompact);
if (distance <= 1) {
return true;
}
return distance === 2 && wakeCompact.length >= 5 && heardCompact.length !== wakeCompact.length;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Tighten fuzzy wake matching to avoid prepended-word triggers

leadingWakeNameCandidates can include multiple leading words, but isFuzzyWakeNameMatch accepts any candidate within edit distance 1 (or 2 with length mismatch). That lets non-address phrases like "an open claw, ..." match the default openclaw wake name (anopenclaw vs openclaw distance 2), so requireWakeName can be bypassed and an agent consult can fire on ambient speech. The fuzzy check should reject candidates that differ by full extra tokens/prefixes rather than minor ASR misspellings.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@steipete

Copy link
Copy Markdown
Contributor Author

Verification before merge:

Local proof:

  • pnpm test extensions/discord/src/voice/manager.e2e.test.ts -- --reporter=verbose passed: 113 tests.
  • env -u OPENCLAW_TESTBOX pnpm check:changed passed.
  • .agents/skills/autoreview/scripts/autoreview --mode local passed with no accepted/actionable findings after the boundary fix.

CI proof:

Known proof gaps:

  • No live Discord voice audio rerun; local E2E covers the wake-gate transcript behavior observed in tmux.

@steipete steipete merged commit 8fe4f34 into main May 25, 2026
192 of 198 checks passed
@steipete steipete deleted the fix/discord-leading-fuzzy-wake-name branch May 25, 2026 13:01
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord maintainer Maintainer-authored PR rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant