Repository navigation
fix(ios): keep Watch voice replies and playback with their original turn - #135697
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 8:34 PM ET / September 2, 2026, 00:34 UTC. ClawSweeper reviewWhat this changesThe PR ties Apple Watch dictation, reply matching, speech playback, and queued iPhone delivery to the original Gateway chat turn. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this maintainer-owned PR open for human review. The receipt-based matching and turn-scoped delivery address behavior still absent from current main, but the prior physical-Watch and old-Gateway compatibility rank-up evidence remains incomplete. Priority: P2 Review scores
Verification
How this fits togetherApple Watch sends a one-turn dictation through its paired iPhone to Gateway chat, then displays and speaks the matching response. The iPhone delivery owner and Watch state store decide whether a response still belongs to the selected Watch chat. flowchart LR
A[Watch native dictation] --> B[Paired iPhone relay]
B --> C[Gateway chat turn]
C --> D[History input receipts]
D --> E[Watch turn matcher]
E --> F[Watch display and speech]
Decision needed
Why: The patch is source-consistent, but the PR itself records both evidence gaps and the previous review requested those same rank-up items. Before merge
Agent review detailsSecurityNone. PR surfaceDocs +46, Config +3, Other +606. Total +655 across 19 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the receipt-based turn owner and single-message delivery model, then land only after the old-Gateway fallback and a physical Watch-to-paired-iPhone voice turn confirm the documented compatibility boundary. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the linked report gives deterministic speech replacement, chat-switch, retry-order, and receipt-attribution sequences, and focused tests cover those boundaries. This read-only review did not execute them. Is this the best way to solve the issue? Yes for the source boundary: state is retired at chat identity changes, receipts replace heuristic attribution, and delivery ownership is per message rather than globally serialized. The remaining question is proof sufficiency for the old Gateway and physical Watch paths, not an identified alternative implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fabe69f3fdf0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…urn (openclaw#135697) * fix(ios): keep Watch voice replies scoped and delivery single-owned * fix(ios): refresh Watch voice localization inventory
Closes #135693
What Problem This Solves
Fixes an issue where Apple Watch voice turns could retain the wrong chat scope, attribute a reply to a neighboring turn, lose replacement speech controls, or resubmit a request that was still in flight on the iPhone.
Why This Change Was Made
Keep each voice turn and delivery attempt attached to its authoritative owner. Watch playback now uses the existing token-scoped system speech owner, chat changes retire the old turn and preview, and native input checks the scope captured when it opened. The phone matches authoritative run metadata and collected-input receipts, respects intervening user turns, and gives each pending request one active delivery owner without blocking unrelated messages behind reply observation.
History receipt requests use the existing optional Gateway contract. The old-Gateway downgrade is limited to its exact shipped unsupported-parameter error; authentication and other failures do not activate a fallback. Redundant speech delegates, metadata decoding, global flush gating, and forwarding/requeue branches are removed.
User Impact
Watch voice replies stay in the correct Gateway/chat and playback controls follow the current utterance. Queued delivery can make progress without duplicating an active send. The docs now distinguish phone-assisted Watch dictation/readback from iPhone realtime voice and the limited direct Watch node.
This PR does not add standalone Watch audio, durable terminal-reply custody, selected-agent identity, or explicit 90-second timeout outcomes; those remain separate work. Cancellation here stops local readback, not the Gateway run.
Evidence
The unchanged candidate passed 346 targeted executions:
The pre-fix in-flight retry sequence observed A, B, B, A; the repaired test observes A, B, B while unrelated B continues to progress. The original native speech reproduction failed twice after replacement, then passed with the same driver against the shared owner. This proves duplicate submission prevention, not duplicate underlying agent execution.
Optimized generic iOS compilation succeeded with embedded Watch arm64 and arm64_32 targets. SwiftFormat passed for all 15 changed/new Swift files; canonical strict SwiftLint passed across 377 production files. Workflow checks, docs formatting/MDX, 7,205-link validation, glossary checks, and diff checks passed. Fresh Codex autoreview before commit completed with no accepted findings at the workflow's P0 threshold.
Commands
Live verification and final checks
All 204 checks on head
05a9effe2d8b621b618cab4e3c4e8227f725fccdpassed. The initial native-i18n failure was fixed by regenerating the native source inventory; no runtime behavior changed in that follow-up. Fresh pre-land Codex autoreview completed with no accepted findings at the workflow's P0 threshold.The published
[email protected]package was started with isolated state. Its realchat.historyendpoint rejectedinputRunIdswithINVALID_REQUESTand exactlyinvalid chat.history params: at root: unexpected property 'inputRunIds'; the request without that field succeeded. This verifies the retained wire contract. Native tests separately cover the exact predicate, one-time downgrade, and scoped reply selection.The unchanged, Simulator-signed iPhone app paired with the isolated Gateway, received three exact replies from the configured public provider, cleared Writing after each, and reopened the live Control overview using saved pairing. The task-local native XCTest driver executed one real test (38.886 seconds, no failures); it changed automation only, not the app. Earlier attempts exposed test-environment problems: a LAN/loopback mismatch, retained intro state, and restarting a Gateway after its hashed build chunks changed. The existing UI helper also tapped a starter instead of dismissing the keyboard. The successful driver verified each typed draft and tapped the actual Send control.
No physical Apple Watch is available on this host. The physical-Watch rank-up is therefore explicitly skipped, not claimed complete. Native Watch Simulator speech callbacks plus the live iPhone/Gateway/provider flow are the available behavior proof; they do not establish hardware dictation, WatchConnectivity radio delivery, wrist-down, roaming, or endurance. Local red/green logs and xcresults remain retained, not public artifact links.
Visual inspection also recorded an independent shared-chat follow-up: an extra unmetered first-reply bubble remains below later correct replies. This PR does not change that projection and does not claim to fix it. The screenshots below demonstrate actual phone replies and saved-pairing reconnect, not before/after Watch voice-race or hardware evidence.
Scope and risk
Production +299/-243 (net +56); tests +600/-52 (net +548); docs +50/-4; CI +3 selectors; generated native-i18n inventory +3/-1. Production growth buys the existing receipt contract and exact lifecycle ownership; the native-input helper extraction is primarily a move. No new configuration keys, persistent representation, or database schema changes. Existing persistence, deadlines, and the old-Gateway public compatibility contract remain unchanged.
Native phone proof