Skip to content

[codex] fix discord missing voice state handling - #90969

Merged
steipete merged 3 commits into
openclaw:mainfrom
asock:discord-voice-absent-fix
Jul 5, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
asock:discord-voice-absent-fix

Conversation

@asock

@asock asock commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Discord returns REST error code 10065 when a guild member has no current voice state. OpenClaw treated that normal disconnected state as a command/gateway failure. The original patch also treated every HTTP 404 as absent, which could hide unrelated unknown-guild, unknown-channel, permission, or transport failures.

Why This Change Was Made

The Discord plugin now recognizes only the provider's semantic Unknown Voice State code, with a narrow explicit-message fallback for legacy error shapes. Guild status and voice manager lookup share that predicate; generic 404 handling is removed.

User Impact

Voice status for a disconnected Discord user returns an explicit absent/disconnected result. Other Discord REST errors continue to surface for diagnosis. No configuration or command changes are required.

Evidence

Implementation

  • Add one internal Discord REST predicate for unknown voice state.
  • Reuse it in guild status and voice manager paths.
  • Preserve every non-10065 exception.
  • Preserve release-note context and contributor credit in this PR; the changelog bullet is queued with the final batch to avoid active-main ordering races.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 6, 2026
@clawsweeper

clawsweeper Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 5:04 PM ET / 21:04 UTC.

Summary
The branch adds a shared Discord Unknown Voice State/code-10065 predicate, returns an absent voice status for that case, reuses it in voice follow-user reconciliation, and adds focused tests.

PR surface: Source +30, Tests +84. Total +114 across 5 files.

Reproducibility: yes. source-reproducible: current main returns getGuildVoiceState directly from voiceStatus and DiscordError preserves numeric API codes, so live code 10065 would propagate today. I did not inspect a redacted live run for the PR head.

Review metrics: 1 noteworthy metric.

  • Inspectable live Discord proof: 0 artifacts/logs attached; 1 maintainer proof claim. This PR changes live Discord REST error semantics, so reviewers need inspectable evidence or an explicit maintainer override before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦞 diamond lobster
Result: blocked until stronger real behavior proof is added.

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

Rank-up moves:

  • Attach redacted live Discord output, logs, or a recording showing code 10065 returns absent and an unrelated invalid-guild error still surfaces.
  • [P1] If maintainers accept private validation, add a visible proof override for the exact current head.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR has CI and a prose live-proof claim, but no redacted output, logs, recording, or artifact that shows the after-fix Discord 10065 and 10004 behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A real Discord proof would materially help because the change affects the visible voiceStatus action result and no dedicated Discord voiceStatus Mantis lane exists. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify in a real Discord setup that voiceStatus returns absent for a disconnected user and still surfaces invalid guild errors.

Risk before merge

  • [P1] Merging intentionally changes existing voiceStatus behavior from a propagated Discord REST error to a successful absent-state object for code 10065, which is caller-visible even though it is the desired fix.
  • [P1] The live Discord proof is currently described in prose but not inspectable as redacted output, logs, recording, or an artifact, so maintainers need either an attached proof artifact or an explicit proof override before merge.

Maintainer options:

  1. Attach live Discord proof first (recommended)
    Require redacted live output, logs, or a recording proving code 10065 becomes an absent voice result while unrelated REST errors still propagate.
  2. Record a proof override
    Accept the assigned maintainer's private live validation as the merge proof, with an explicit visible override for the exact head.
  3. Pause until proof exists
    Keep the PR open without merging if no one can provide inspectable Discord proof for the changed action result.

Next step before merge

  • [P1] Manual proof handling remains because the code repair is done and the remaining question is whether private maintainer proof is acceptable without an inspectable artifact.

Maintainer decision needed

  • Question: Should this PR wait for reviewer-inspectable live Discord proof at the current head, or may the assigned maintainer accept private live validation for the code-10065 voiceStatus behavior change?
  • Rationale: The code and tests support the fix, but the changed behavior depends on Discord's live REST response and the public PR evidence still lacks inspectable redacted output or logs.
  • Likely owner: steipete — steipete is assigned, authored the current narrowing and cleanup commits, and has the strongest recent history on the touched Discord REST and voice paths.
  • Options:
    • Require inspectable proof (recommended): Ask for redacted live Discord terminal output, logs, or a recording showing code 10065 returns absent while an unrelated error such as code 10004 still surfaces.
    • Accept maintainer-owned proof: A maintainer can explicitly record a proof override for the exact head if private live validation is sufficient for this merge.
    • Keep paused: Leave the PR open until the author or maintainer can attach inspectable Discord proof instead of merging on tests and prose claims alone.

Security
Cleared: Cleared: the diff is limited to Discord plugin error classification and tests; it does not change dependencies, workflows, permissions, secrets, or code-download paths.

Review details

Best possible solution:

Merge the narrowed code-10065 predicate after inspectable Discord proof is attached or a maintainer explicitly records a proof override for the exact head.

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

Yes, source-reproducible: current main returns getGuildVoiceState directly from voiceStatus and DiscordError preserves numeric API codes, so live code 10065 would propagate today. I did not inspect a redacted live run for the PR head.

Is this the best way to solve the issue?

Yes for the code shape: a shared Discord REST-error predicate keyed to code 10065 is narrower than status-only 404 handling and fits the plugin boundary. The remaining issue is proof sufficiency, not an alternate implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 51771c3a1485.

Label changes

Label justifications:

  • P2: This is a bounded Discord plugin bug fix with limited blast radius, but it changes user-visible action error semantics and still needs proof handling before merge.
  • merge-risk: 🚨 compatibility: Merging changes existing voiceStatus callers from receiving a propagated Discord REST error to receiving a successful absent-state object for code 10065.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦞 diamond lobster.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR has CI and a prose live-proof claim, but no redacted output, logs, recording, or artifact that shows the after-fix Discord 10065 and 10004 behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +30, Tests +84. Total +114 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 4 41 11 +30
Tests 1 84 0 +84
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 125 11 +114

What I checked:

Likely related people:

  • steipete: Current-main blame for fetchVoiceStatusDiscord, DiscordError.discordCode storage, and the existing voice reconciliation classifier points to Peter Steinberger, and steipete authored the narrowing and changelog-removal commits on this PR. (role: recent Discord REST/voice contributor and likely follow-up owner; confidence: high; commits: 35272d01b5dd, a3a47e8dd8fb, 7bc8b18ef69c; files: extensions/discord/src/send.guild.ts, extensions/discord/src/internal/rest-errors.ts, extensions/discord/src/voice/manager.ts)
  • vincentkoc: git log -S on the touched Discord REST and voice symbols shows recent work by Vincent Koc on the same current files before this PR. (role: recent adjacent Discord voice contributor; confidence: medium; commits: e085fa1a3ffd; files: extensions/discord/src/internal/rest-errors.ts, extensions/discord/src/send.guild.ts, extensions/discord/src/voice/manager.ts)
  • scoootscooob: The touched Discord send and voice files trace back to the Discord channel move into extensions, which established the current plugin-owned file boundary. (role: Discord extension migration author; confidence: medium; commits: 5682ec37fada; files: extensions/discord/src/send.guild.ts, extensions/discord/src/voice/manager.ts)
  • Gustavo Madeira Santana: The voiceStatus runtime action surface was introduced in the Discord action runtime migration, which is the caller that exposes fetchVoiceStatusDiscord results. (role: adjacent action runtime contributor; confidence: medium; commits: 9df3e9b617b2; files: extensions/discord/src/actions/runtime.guild.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.
Review history (5 earlier review cycles)
  • reviewed 2026-06-21T18:23:11.003Z sha 10a76a9ac2d985f91bcf21cf46860e7dfb9c2b46 :: needs real behavior proof before merge. :: [P2] Narrow 404 handling to Unknown Voice State
  • reviewed 2026-07-05T18:40:01.265Z sha f03cd49485083695a72b1bacb25efb7e814a7888 :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-07-05T20:25:55.805Z sha 90f6040c3ba6e246b2c0637faa82b27fab2c0070 :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-07-05T20:37:41.469Z sha bc6faf91f3f511cdff02aef99cd0fb09530ef121 :: needs real behavior proof before merge. :: [P3] Remove the manual changelog entry
  • reviewed 2026-07-05T20:57:27.295Z sha c8ab66803c94025accb6d5a3e1765ba515e64643 :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog entry

@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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 6, 2026
@steipete steipete self-assigned this Jul 5, 2026
@steipete
steipete force-pushed the discord-voice-absent-fix branch from 10a76a9 to f03cd49 Compare July 5, 2026 18:26
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 5, 2026
@steipete
steipete marked this pull request as ready for review July 5, 2026 18:32
@steipete
steipete force-pushed the discord-voice-absent-fix branch 2 times, most recently from 90f6040 to bc6faf9 Compare July 5, 2026 20:27

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

Copy link
Copy Markdown
Contributor

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: bc6faf91f3

ℹ️ 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 thread CHANGELOG.md Outdated
@@ -21,6 +21,7 @@ Docs: https://docs.openclaw.ai
- **IRC Unicode messages:** split outbound PRIVMSG payloads on UTF-16 code-point boundaries so emoji cannot be cut into lone surrogates. (#96572) Thanks @llagy009.
- **OpenAI realtime voice greetings:** prevent server VAD from creating a second outbound greeting while an explicit greeting response owns the turn, without disabling caller interruption. (#86285) Thanks @giodl73-repo.
- **iOS Voice Wake cleanup:** avoid initializing the microphone audio pipeline while disabling inactive Voice Wake, preventing simulator launch aborts and unnecessary audio setup.
- **Discord voice status:** return an explicit absent state for Discord error 10065 while preserving unrelated 404 failures. (#90969) Thanks @asock.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Remove the manual changelog entry

For this normal Discord fix, the root AGENTS.md says CHANGELOG.md is release-only and normal fixes should carry release-note context in the PR body, squash message, or direct commit instead. Keeping this hand-written entry means release generation no longer owns the changelog content and can leave duplicate or stale release notes for this fix, so remove the CHANGELOG.md edit from this commit.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the discord-voice-absent-fix branch from bc6faf9 to c8ab668 Compare July 5, 2026 20:44
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Exact-head land-ready proof for 7bc8b18ef69c638c2f49375bf808a99ba2e9548e:

Known proof gaps: none for the changed surface.

@steipete
steipete force-pushed the discord-voice-absent-fix branch from c8ab668 to 7bc8b18 Compare July 5, 2026 20:59
@steipete
steipete merged commit 20163ee into openclaw:main Jul 5, 2026
95 checks passed
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
* fix(discord): treat missing voice state as absent

* fix(discord): narrow absent voice state handling

* chore: defer Discord voice changelog

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants