Skip to content

fix(providers): preserve realtime transcripts and final tool arguments - #116891

Merged
steipete merged 1 commit into
mainfrom
codex/qa200-realtime-provider-owner
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa200-realtime-provider-owner

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Surface official input-audio transcription failures and actionable decoder details in both OpenAI and xAI realtime provider owners; discard failed xAI transcript replacements.
  • Execute the authoritative completed function-call arguments instead of stale or truncated streaming deltas in both providers.
  • Preserve standard xAI user transcript deltas and finalized legacy assistant text across both OpenAI-style realtime bridges.
  • Keep identical phrases from separate xAI streaming-transcription turns while still suppressing duplicate final/terminal events inside one turn.
  • Preserve provider/plugin ownership and existing public realtime event, SDK, protocol, authentication, configuration, and persistence contracts.

Distinct root causes

  1. Provider-owned input transcription failures were silently dropped.
  2. Draft streamed tool arguments incorrectly overrode authoritative completed arguments.
  3. xAI dropped standard user-transcript delta events.
  4. Legacy finalized assistant text events were ignored.
  5. xAI deduplicated identical user speech across distinct utterances.

Verification

  • Frozen clean baseline: e051a7bb4a6ba69b87391e990b00813114b1d482; exact local candidate: b99da311b8100d5a71cea59afb3868f6ae69b117.
  • Read-only localhost WebSocket proof first reproduced all five user-visible failures directly on frozen canonical main; no hosted model or live provider was called.
  • Exact-candidate localhost WebSocket proof observed speech decoder exploded for both providers, corrected { city: "Paris" } tool calls and authoritative empty {} final arguments, xAI user partial, corrected corrected assistant final text, and independent ["yes", "yes"] streaming-transcription turns.
  • OpenAI focused private realtime provider suite: 96/96 passed.
  • xAI focused voice/transcription run: 53 tests passed; the sole new test failure was an incorrect expectation that provider callbacks survive an intentional close. Its expectation was corrected to the actually observed two successful final speech turns. Exact corrected-suite rerun remains queued for remote capacity because the coordinator prohibited further local suites under critical host disk/load pressure.
  • Six-file oxfmt --check, git diff --check, exact parent SHA, and clean isolated worktree checks passed.
  • Direct upstream SDK inspection: node_modules/openai/src/resources/realtime/realtime.ts:462, node_modules/openai/src/resources/realtime/realtime.ts:4730, node_modules/openai/src/resources/realtime/realtime.ts:4770, and node_modules/openai/src/resources/beta/realtime/realtime.ts:2112.
  • Direct Codex protocol inspection: ../codex/codex-rs/codex-api/src/endpoint/realtime_websocket/protocol_v1.rs:42, ../codex/codex-rs/codex-api/src/endpoint/realtime_websocket/protocol_v2.rs:32, ../codex/codex-rs/codex-api/src/endpoint/realtime_websocket/protocol_v2.rs:39, and ../codex/codex-rs/codex-api/src/endpoint/realtime_websocket/methods.rs:1215.
  • Initial genuine structured review and official shared TruffleHog scan completed; its one actionable explicitly-empty final-arguments finding was fixed for both providers. Final exact-commit Codex gpt-5.6-sol/high structured autoreview: clean, zero findings, 0.94 confidence; campaign-shared official TruffleHog preflight: clean.

Explicit exclusions

The already-landed Mistral final-transcript fix and held cross-owner public response.done terminal-status event-contract change are untouched. Equivalent Deepgram/ElevenLabs repeated-phrase deduplication remains a separately scoped provider-owner follow-up.

@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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 11:20 AM ET / 15:20 UTC.

ClawSweeper review

What this changes

The PR changes OpenAI and xAI realtime provider event handling so user and assistant transcripts, transcription failures, and authoritative completed tool-call arguments reach the voice session correctly.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 6 items remain

Keep this PR open for human review. The checkout could not run even a read-only inspection command because the sandbox failed while configuring loopback networking, so I could not verify the current head, applicable scoped policy, source behavior, history, or the claimed proof artifact; the existing maintainer label also prevents automated cleanup closure.

Priority: P1
Reviewed head: 637167659d5d4ab6bf2a06f85194d5e07483b1d8
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The proposed repair is targeted and has described tests, but the real behavior proof is not independently inspectable and the review environment could not inspect the branch.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The body claims after-fix localhost WebSocket observations, but no inspectable redacted trace, recording, terminal output, runtime log, or linked artifact was available to verify them against the current head. Please add redacted evidence; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review if it does not. 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 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The body claims after-fix localhost WebSocket observations, but no inspectable redacted trace, recording, terminal output, runtime log, or linked artifact was available to verify them against the current head. Please add redacted evidence; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review if it does not. 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 3 items Read-only inspection blocked: The required initial read-only command failed before it could read repository policy, source, tests, history, or PR files: bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted.
Protected handling signal: The provided PR context includes the maintainer label, which requires explicit maintainer handling rather than automatic close or cleanup.
Existing proof gate remains unresolved: The prior completed ClawSweeper cycle rated proof as insufficient because it could not inspect a raw redacted trace, recording, log, or linked artifact; this review could not verify whether the follow-up branch or PR body now provides independently inspectable after-fix evidence.
Findings None None.
Security None None.

How this fits together

OpenAI and xAI realtime provider bridges receive WebSocket events and translate them into transcript callbacks, tool-call execution requests, and operator-visible errors for OpenClaw voice sessions. These outputs affect what users hear or see in the session and which arguments reach an invoked tool.

flowchart LR
  Provider[Realtime provider WebSocket] --> Bridge[Provider event bridge]
  Bridge --> Transcript[Transcript callbacks]
  Bridge --> ToolCall[Tool-call requests]
  Bridge --> Error[Error callbacks]
  Transcript --> Session[Voice session]
  ToolCall --> Session
  Error --> Session
Loading

Decision needed

Question Recommendation
Should a maintainer review this protected realtime-provider PR after an environment-capable reviewer verifies the exact head and contributor proof? Request inspectable proof and re-review: Ask for a redacted runtime trace or terminal transcript on the current head, then complete source and dependency-contract review before deciding on merge.

Why: The maintainer label blocks automated cleanup, and the local read-only environment failed before current code, dependency contracts, history, and proof could be checked.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The body claims after-fix localhost WebSocket observations, but no inspectable redacted trace, recording, terminal output, runtime log, or linked artifact was available to verify them against the current head. Please add redacted evidence; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review if it does not. 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) - The branch changes provider event translation that can affect user transcripts and tool-call arguments, but source inspection could not confirm current-main contracts or sibling-provider consistency.
  • Resolve merge risk (P1) - The PR body asserts localhost WebSocket proof, but no independently inspectable redacted trace, recording, log, or linked artifact was available in the supplied context.
  • Resolve merge risk (P1) - Some required checks were still in progress in the supplied context; that is not itself a priority escalation, but merge review should use their final results.
  • Complete next step (P2) - A protected realtime-provider PR needs human review because the exact head, dependencies, proof artifact, and current-main behavior could not be inspected in the failed read-only environment.
Agent review details

Security

None.

PR surface

Source +26, Tests +357. Total +383 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 30 4 +26
Tests 3 366 9 +357
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 396 13 +383

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/openai/realtime-voice-provider.test.ts, serialized state: extensions/xai/realtime-transcription-provider.test.ts, serialized state: extensions/xai/realtime-voice-provider.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify event-contract coverage before merge (recommended)
    Confirm on the rebased head that transcript, error, and completed-tool-call events preserve their documented ordering and payload semantics for both providers.
  2. Pause for owner review
    Keep the PR pending if the provider event contracts or actual after-fix runtime evidence cannot be independently verified.

Technical review

Best possible solution:

Review the exact rebased head after the inspection environment is restored, then require a redacted after-fix WebSocket trace or terminal transcript showing each corrected provider event before merge.

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

Unclear. The PR body describes a localhost WebSocket reproduction on a frozen baseline, but the read-only inspection environment failed before that setup, the current head, or a linked runtime artifact could be checked.

Is this the best way to solve the issue?

Unclear. The described provider-owned fixes are plausible, but it is not yet possible to confirm that they are the narrowest correct solution without reading the exact branch, current main, upstream event types, and sibling handling.

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label justifications:

  • P1: The proposed repair concerns realtime transcripts and tool-call arguments, which can disrupt active voice-session workflows.
  • merge-risk: 🚨 message-delivery: The patch changes how realtime provider events become user and assistant transcript callbacks, so an unverified contract change could suppress or misstate delivered session messages.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; 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 stronger real behavior proof before merge: The body claims after-fix localhost WebSocket observations, but no inspectable redacted trace, recording, terminal output, runtime log, or linked artifact was available to verify them against the current head. Please add redacted evidence; updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review if it does not. 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:

  • Read-only inspection blocked: The required initial read-only command failed before it could read repository policy, source, tests, history, or PR files: bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted.
  • Protected handling signal: The provided PR context includes the maintainer label, which requires explicit maintainer handling rather than automatic close or cleanup. (637167659d5d)
  • Existing proof gate remains unresolved: The prior completed ClawSweeper cycle rated proof as insufficient because it could not inspect a raw redacted trace, recording, log, or linked artifact; this review could not verify whether the follow-up branch or PR body now provides independently inspectable after-fix evidence. (b99da311b810)

Likely related people:

  • steipete: The provided GitHub context identifies this person as the author of the current realtime-provider repair; checkout failure prevented the required current-main feature-history ownership trace. (role: current PR author and reported implementation owner; confidence: low; commits: 637167659d5d; files: extensions/openai/realtime-voice-provider.ts, extensions/xai/realtime-voice-events.ts)

Rank-up moves

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

  • Add a redacted current-head WebSocket trace, terminal transcript, log, or recording that demonstrates the corrected events for both providers.
  • Re-run review after an environment-capable reviewer checks current source, upstream event contracts, and the focused provider tests.

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-07-31T14:54:25.615Z sha b99da311b8100d5a71cea59afb3868f6ae69b117 :: needs real behavior proof before merge. :: none

@steipete
steipete force-pushed the codex/qa200-realtime-provider-owner branch from b99da31 to 6371676 Compare July 31, 2026 15:16
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label Jul 31, 2026
@steipete
steipete merged commit 0d20999 into main Jul 31, 2026
88 checks passed
@steipete
steipete deleted the codex/qa200-realtime-provider-owner branch July 31, 2026 15:33
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: openai extensions: xai maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. 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.

1 participant