Skip to content

fix(xai): preserve authoritative realtime response outcomes - #117186

Merged
vincentkoc merged 1 commit into
mainfrom
codex/qa400-providers-mistral-xai-together
Aug 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
codex/qa400-providers-mistral-xai-together

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where xAI realtime voice users could lose assistant transcripts present only in the terminal response, receive no actionable explanation for failed or incomplete model turns, and silently miss completed tool calls present only in supported response output.

Why This Change Was Made

The existing private xAI event owner now consumes authoritative terminal response status, provider error details, assistant output, and completed function-call output. Newly recovered output-item calls wait for a successful terminal response and deduplicate against final output. Existing streamed-argument completion and resumed conversation replay remain immediate, as required by xAI's documented function-call flow. A duplicated bridge-readiness wrapper is removed.

User Impact

  • Final-only assistant speech transcripts remain visible.
  • Failed or incomplete xAI turns report actionable provider errors.
  • Recovered output-only tool calls execute once after successful completion.
  • Existing immediate streamed tool execution, resumed replay, cancellation, and audio handling retain their provider contracts.

Evidence

});
const server = createServer();
const sockets = new Set<WebSocket>();
const wss = new WebSocketServer({ noServer: true });
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 6:27 AM ET / 10:27 UTC.

ClawSweeper review

What this changes

The PR updates the xAI realtime voice plugin to consume terminal response output and status, preserving final assistant transcripts, surfacing terminal failures, and delivering completed output-only tool calls once.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

This PR remains necessary: current main still ignores terminal xAI response output/status, so final-only transcripts, terminal failure details, and output-only completed tool calls can be lost. The focused owner-boundary repair and loopback regression coverage look correct, but merge should wait for redacted after-fix proof from a real xAI realtime session; the existing proof is scripted-provider integration coverage only.

Priority: P2
Reviewed head: a02cc5c8495316bc1b05df9d24d836edbca74917

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and well-covered by loopback regression tests, but real-provider proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body and added test demonstrate a real local bridge over HTTP/WebSocket but script the provider’s events; add a redacted after-fix xAI realtime trace, terminal output, or provider artifact before merge and redact keys, endpoints, IP addresses, and other private data. 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.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body and added test demonstrate a real local bridge over HTTP/WebSocket but script the provider’s events; add a redacted after-fix xAI realtime trace, terminal output, or provider artifact before merge and redact keys, endpoints, IP addresses, and other private data. 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 5 items Current-main behavior remains incomplete: Current main handles response.done by flushing the streamed transcript buffer and clearing response state, but it does not inspect terminal response.status, response.status_details, or response.output; it also has no response.output_item.done handling.
Candidate repairs the owning terminal-event boundary: The proposed response.done path consumes authoritative terminal output/status, delays output-item function calls until successful completion, and reuses emitToolCallOnce for deduplication; immediate streamed argument completion remains separate.
Regression coverage exercises the actual bridge over loopback HTTP/WebSocket: The added test creates the provider bridge, sends terminal events through a loopback WebSocket server, and checks final-only transcripts, failed/incomplete outcomes, deferred tool calls, and deduplication. Its provider events are scripted, so it is integration-style mock proof rather than real xAI behavior proof.
Findings None None.
Security None None.

How this fits together

The xAI realtime voice plugin receives provider WebSocket events and translates them into assistant transcript callbacks, provider errors, and tool-call callbacks for a voice session. Terminal response events are the final authoritative signal that determines whether output is visible, an error is reported, or deferred tool work may run.

flowchart LR
  A[xAI realtime WebSocket events] --> B[xAI voice event owner]
  B --> C[Terminal response status and output]
  C --> D[Assistant transcript callback]
  C --> E[Actionable provider error]
  C --> F[Completed tool-call delivery]
  D --> G[Voice session]
  E --> G
  F --> G
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body and added test demonstrate a real local bridge over HTTP/WebSocket but script the provider’s events; add a redacted after-fix xAI realtime trace, terminal output, or provider artifact before merge and redact keys, endpoints, IP addresses, and other private data. 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.
  • Resolve merge risk (P1) - Merging changes when xAI terminal output and tool calls are delivered; current coverage uses scripted provider frames, so a real xAI realtime trace is still needed to confirm the vendor’s observed ordering and payload shape.
  • Complete next step (P2) - The patch has no discrete code defect to auto-repair; its remaining gate is contributor-supplied real-provider proof, and the maintainer label requires explicit human handling.
Agent review details

Security

None.

PR surface

Source +43, Tests +265. Total +308 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 68 25 +43
Tests 1 265 0 +265
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 333 25 +308

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/xai/realtime-voice-terminal-outcomes.test.ts, serialized state: extensions/xai/realtime-voice-terminal-outcomes.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Add real xAI terminal-outcome proof (recommended)
    Attach a redacted after-fix xAI realtime trace or provider artifact showing the changed terminal-response path before merging.
  2. Accept the scripted-provider evidence
    A maintainer may explicitly accept the loopback bridge coverage as sufficient while owning the remaining vendor-contract uncertainty.

Technical review

Best possible solution:

Keep terminal response status/output ownership in extensions/xai/realtime-voice-events.ts, retain immediate streamed-argument tool execution, and add a redacted after-fix real xAI realtime trace that demonstrates terminal-only transcript, terminal error, or output-only tool-call behavior before merge.

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

Yes—source-reproducible with high confidence: current main’s terminal response handler ignores output and failure status, while the added loopback bridge test supplies the exact missing event shapes. The review did not execute the test because this is a read-only inspection.

Is this the best way to solve the issue?

Yes—the PR repairs the existing xAI event owner rather than adding a parallel path, preserves the documented immediate streamed-function-call flow, and uses existing tool-call deduplication. A real provider trace remains necessary to validate the vendor contract rather than change the solution direction.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded provider voice-flow defect that can lose final user-visible transcript or tool-call outcomes.
  • merge-risk: 🚨 message-delivery: The patch changes the realtime event ordering and conditions under which assistant transcripts and tool calls are delivered.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • 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 and added test demonstrate a real local bridge over HTTP/WebSocket but script the provider’s events; add a redacted after-fix xAI realtime trace, terminal output, or provider artifact before merge and redact keys, endpoints, IP addresses, and other private data. 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

What I checked:

  • Current-main behavior remains incomplete: Current main handles response.done by flushing the streamed transcript buffer and clearing response state, but it does not inspect terminal response.status, response.status_details, or response.output; it also has no response.output_item.done handling. (extensions/xai/realtime-voice-events.ts:131, b6b440d07680)
  • Candidate repairs the owning terminal-event boundary: The proposed response.done path consumes authoritative terminal output/status, delays output-item function calls until successful completion, and reuses emitToolCallOnce for deduplication; immediate streamed argument completion remains separate. (extensions/xai/realtime-voice-events.ts:133, a02cc5c84953)
  • Regression coverage exercises the actual bridge over loopback HTTP/WebSocket: The added test creates the provider bridge, sends terminal events through a loopback WebSocket server, and checks final-only transcripts, failed/incomplete outcomes, deferred tool calls, and deduplication. Its provider events are scripted, so it is integration-style mock proof rather than real xAI behavior proof. (extensions/xai/realtime-voice-terminal-outcomes.test.ts:45, a02cc5c84953)
  • Feature-history provenance: The current xAI realtime event owner was introduced in commit ee320a6; blame attributes the original response-created and conversation-item logic to Peter Steinberger, making the candidate's owner-boundary placement consistent with the current design. (extensions/xai/realtime-voice-events.ts:41, ee320a6e4114)
  • Current-main and release status: The candidate commit is not present in the checked-out current-main implementation, and no shipped-fix provenance exists because the PR is still open. Network DNS prevented an additional live GitHub/tag query, but the direct current-main source check establishes that the requested behavior is not already implemented. (extensions/xai/realtime-voice-events.ts:131, b6b440d07680)

Likely related people:

  • steipete: Peter Steinberger introduced the current xAI realtime event owner on main and authored the candidate repair, including its terminal-event ownership and regression coverage. (role: feature owner and recent area contributor; confidence: high; commits: ee320a6e4114, a02cc5c84953; files: extensions/xai/realtime-voice-events.ts, extensions/xai/realtime-voice-bridge.ts, extensions/xai/realtime-voice-config.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach a redacted after-fix xAI realtime trace or captured provider artifact that visibly exercises a terminal transcript, failure, or output-only tool-call path.
  • Update the PR body with that proof; ClawSweeper should re-review automatically, or a maintainer can request @clawsweeper re-review if needed.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-01T03:18:30.800Z sha a02cc5c :: needs real behavior proof before merge. :: none

@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@vincentkoc
vincentkoc merged commit 7c7e519 into main Aug 1, 2026
97 of 103 checks passed
@vincentkoc
vincentkoc deleted the codex/qa400-providers-mistral-xai-together branch August 1, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: xai maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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.

3 participants