Repository navigation
fix: preserve dictation text across xAI chunks and Stop - #180923
Conversation
…iews xAI chunk-final events (is_final without speech_final) lock the utterance so far, and the following interims carry only the tail after the locked chunk. The provider forwarded every non-terminal event as a plain partial, so the composer preview shrank mid-utterance and stopping in that window lost the locked text permanently. Chunk finals are now retained and stitched onto later interims, matching the Deepgram provider; the utterance final still emits the full transcript and clears the lock.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThe PR retains successive xAI transcription chunks and waits for final transcription after Stop before inserting dictated text. Example: xAI locks “First.”, previews “Second.”, and completes transcription after the user presses Stop.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: current main still loses dictated text, and the focused rewrite addresses both previous findings without a new concrete correctness finding. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherBrowser microphone audio passes through Gateway Talk transcription to the xAI WebSocket adapter; partial and final events return to the dictation session, which inserts text into the owning composer draft. flowchart LR
A[Browser microphone] --> B[Dictation session]
B --> C[Gateway Talk relay]
C --> D[xAI transcription adapter]
D --> E[xAI WebSocket service]
E --> D
D --> C
C --> B
B --> F[Composer draft]
Technical reviewBest possible solution: Retain xAI chunks in the provider and route every Stop through the existing session drain while preserving preview fallback and draft cancellation. Do we have a high-confidence way to reproduce the issue? The linked report provides Chromium and xAI event traces, and current-main source independently shows both truncation mechanisms; no target code was executed during this review. Is this the best way to solve the issue? The patch fixes each cause at its existing owner, removes the competing immediate-commit path, and updates Split Talk to the same finalization contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 853e92c5110d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +20, Tests +117, Docs +9. Total +146 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 23, 2026, 12:48 AM ET / 04:48 UTC (Revision 2). |
…e-180845-xai-chunk-final
…e-180845-xai-chunk-final
|
Addressed both concrete findings in the maintainer rewrite: successive chunk finals now accumulate, and a replacement stream settles the old locked prefix before accepting new partials. The rewrite also fixes the issue's nonempty Stop path by using the existing final drain, with preview fallback and current draft/session/connection checks. The contributor commit is preserved. The PR body records the regression assertions, scoped-clean Codex autoreview through P2, and local execution limitations. Live Gateway/channel/Control UI proof was skipped under the maintainer proof policy; exact-head PR CI supplies tests and lint. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer disposition of the exact-head re-review: both previous code findings are resolved, and the review now reports a complete fix with no actionable findings. The remaining hold is proof-only. For this maintainer takeover, the approved proof policy explicitly uses PR CI for execution and skips live Gateway/channel/Control UI e2e. That proof-only hold is overridden for this task; it does not require a code change or another re-review. Exact-head CI run https://github.com/openclaw/openclaw/actions/runs/39901721044 passed at The PR remains open and unmerged for the separate landing step. |
|
Merged via squash.
|
) * fix(xai): keep locked chunk-final text in realtime transcription previews xAI chunk-final events (is_final without speech_final) lock the utterance so far, and the following interims carry only the tail after the locked chunk. The provider forwarded every non-terminal event as a plain partial, so the composer preview shrank mid-utterance and stopping in that window lost the locked text permanently. Chunk finals are now retained and stitched onto later interims, matching the Deepgram provider; the utterance final still emits the full transcript and clears the lock. * fix: preserve dictation text through chunking and stop --------- Co-authored-by: Peter Steinberger <[email protected]>
Address the ClawSweeper source review of draft PR openclaw#205794 at 95b1575. Related: openclaw#205645. - Reuse the existing Gateway presentation scope so transport-only epoch changes do not discard an admitted recording. Existing client, account, session, permission and draft guards still retire actual destination changes. - Remove the lexical correction planner. Every Explicit preparation retains the exact original and returns unavailable with no edit plan. This also preserves "I work Tuesday, no Wednesday shifts are available" without adding keyword exceptions. Off and one-capture Literal keep their raw paths. - Keep unresolved capture ownership and the policy sampled at admission. Refuse another enabled capture until the pending one is resolved. Preserve Escape cancellation during lazy preparation and Off final drain, while an open composer menu gets the first Escape. - Preserve the received-preview recovery intent of PR openclaw#180923 / 71eb77b in the existing capture/final-drain/ordered-commit owner. Author regressions through the actual lifecycle/context builder for disconnect, delayed final, timeout, failure and retained late callbacks. - Align review copy and WebChat documentation with original-only availability. Extend actual preference-sync and mounted control fixtures; distinguish injected presentation cases from real capture and provider qualification. Validation for this revision: independent static source review; native Git whitespace and tree checks; trusted text/hash and literal-LF accounting only. No repository code was executed. Focused tests, types, lint, formatter, canonical localization/baseline and ratchet gates, builds, real browser/Gateway, microphone/provider, assistive technology and stable-upgrade proof are NOT RUN or NOT COLLECTED. The permitted isolation probe failed before repository code; no weaker isolation, workflow dispatch or re-review request was used. Earlier branch test summaries do not qualify these changed files. Test allocation is 1,859 beyond the ordinary 400 lines: the complete feature adds 2,259 literal test lines against b48d578. The distinct boundaries are lifecycle recovery, ordered cancellation, capture admission, local preference sync, mounted input ownership, presentation and structural range validation. This repair removes 302 production lines and adds 810 test lines relative to the reviewed parent. The complete feature still adds 1,261 production lines; the reduction is not a whole-feature size claim. Semantic correction generation, placement, shared preference decisions and the broader acceptance criteria remain unresolved. This is a draft repair, not a feature-completion, maintainer-acceptance or product-validation claim.
Fixes #180845
What Problem This Solves
Fixes: Control UI dictation loses earlier words after short pauses with xAI, and loses trailing words when Stop commits a nonempty preview before transcription finishes.
User Impact
Dictation retains successive locked chunks and inserts the completed transcript after Stop. Capture stops and the composer unlocks immediately; timeout, disconnection, or failed finalization preserves the received preview. Canceling, changing draft/session/connection, or starting another voice action retires the pending insertion. No configuration changes or migration are required.
Why This Change Was Made
The xAI adapter forwarded tail-only interim events as complete previews. The initial contributor fix retained one chunk but replaced it on the next chunk final and carried it into replacement streams. The maintainer rewrite accumulates every locked chunk, emits xAI's already-stitched utterance final unchanged, and settles locked text before a replacement stream starts. Reconnect intentionally discards the old stream's unconfirmed tail.
The composer also committed nonempty snapshots before its existing final drain could receive trailing words. Stop now uses that drain for every transcript, preserving the pre-Stop preview on failed finalization and rechecking ownership before insertion. Removing the immediate-commit branch and obsolete finalization flag keeps dictation and Split Talk on one finalization path.
Thanks @mushuiyu886 for the initial fix and regression. The contributor commit remains in this PR's history; main was merged without rebasing.
Evidence
e2b9abadc93d7f177e6bf8e77829a585ec850cbc: the xAI nonterminal branch callsonPartial(text)unchanged, and the composer immediately commits a nonempty snapshot before callingfinish()without draining.git diff --check: passed. Simplification pass: removed the early commit path and obsolete finalization option. Production +49/-29 (net +20), tests +161/-44 (net +117), docs +9/-0. Remaining production growth stores locked chunks and preserves failure/ownership behavior; unrelated deletions were not used to meet a line quota.720b6311d32e8e43c282b0bcc28c75c8f8593ac7; the final check rollup was 47 passing, 55 skipped, zero failures/pending. Lint, format, production/test types, UI suites, and changed Node/extension checks passed without reruns.ClawSweeper's exact-head re-review confirms a complete fix and no actionable code findings. The previous successive-chunk P1 and reconnect P2 are resolved. Its only remaining hold requests live Control UI/Gateway proof; the maintainer proof policy above explicitly overrides that proof-only hold.