Repository navigation
feat(watch): add native standalone realtime voice - #135808
Conversation
|
🦞👀 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: blocked before merge. Reviewed September 4, 2026, 11:44 PM ET / September 5, 2026, 03:44 UTC. ClawSweeper reviewWhat this changesAdds opt-in Apple Watch voice calls using native WebRTC/Opus audio, iPhone-assisted setup, and Gateway-owned control, tools, and transcripts. Merge readiness⛔ Blocked before merge - 3 items remain This remains a distinct, maintainer-backed capability: the merged supporting repairs do not replace standalone Watch voice. No concrete introduced blocking defect was established. Priority: P2 Review scores
Verification
How this fits togetherThe Watch becomes a thin voice client provisioned by the iPhone. Audio travels directly to the voice provider, while an authenticated Gateway connection controls the call and runs the agent. flowchart LR
A[iPhone setup] --> B[Scoped Gateway grants]
B --> C[Watch call controller]
C --> D[Native audio and WebRTC]
D <--> E[Voice provider]
C <--> F[Gateway Talk control]
F <--> E
F --> G[Agent tools and transcripts]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +278, Tests +191, Docs +251, Config +40, Other +17723. Total +18483 across 62 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one call/attempt owner with synchronous media fencing and shared Gateway authorization, avoiding a second control stack or permanent provider credentials on the Watch. Do we have a high-confidence way to reproduce the issue? Not applicable to the central feature request. Supplied Simulator/provider observations demonstrate scoped native behavior; no runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes at the architectural boundary: native media supplies phone-independent Watch audio while existing Talk and bootstrap owners retain authorization, provider control, and agent execution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cf127a39cb97. 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 (37 earlier review cycles; latest 8 shown)
|
|
Keeping this draft. The complete Watch microphone-to-speaker call, physical-device behavior, and media-side revocation/replacement proof remain open gates. The real HTTP revocation proof in merged #135904 covers the command/control boundary; it is not a substitute for Watch media proof. Retargeting and exact-head integration checks will follow the parent landing. The upstream dependency inspection was possible on the maintainer host. I inspected the pinned str0m 0.23.1 sources, including its published run-loop contract, alongside the complete Rust C ABI and Swift transport. Two metadata corrections: the production +259/-207 and test +399/-144 figures in this review belong to the notification parent. The full feature diff from its recorded base through a8c7528 is production +2743/-271 and tests/fixtures +1130/-377. Generated localization, the Cargo lockfile, license notices, build files, and docs are classified separately in the body. The referenced setup schema adds the explicit |
1353845 to
7623891
Compare
a8c7528 to
7127990
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Review disposition: numeric IPv4 resolutionThe NAT64 finding is a false positive against Apple’s documented resolver contract. Apple’s “Use System APIs to Synthesize IPv6 Addresses” guidance explicitly supports passing an IPv4 literal to The resolver at ab81b616 follows that route with The translated-address tests cover downstream planning, not the system resolver on a real DNS64/NAT64 network. That network-specific proof remains unrun; it is not evidence that numeric-literal synthesis is unsupported. Updated proof and remaining scopeFresh native products bound to ab81b61 passed the rebuilt native/provider checkpoint: one method, 398 decoded Opus packets with zero decode errors, 362 outgoing RTP admissions and acknowledged input transcription. Revocation rejected the old grant, closed control with WebSocket code 4001, and received HTTP 200 for the same call’s provider hangup before fixture cleanup. This used the unchanged Gateway source composition; owned runtime resources were subsequently cleaned up. This is synthetic Simulator media evidence—not full-controller, physical Watch microphone/speaker, real NAT64-network or endurance validation. Those limitations remain explicit. Exact-head CI still needs to finish successfully; its known config51 missing-doc-reference failure is being repaired separately. |
|
The native dependency/toolchain evidence item has been checked against reviewed head The CI step uses the runner's existing rustup to install The retained local rustup installer and installed copies match the official versioned checksum. The pinned official toolchain manifest's checksum verifies, and its relevant component URLs/hashes match the installed manifest. This is distinct from the earlier 142-crate archive /7,352-source-file verification, whose package/checksum set still exactly matches this head. All ten RTC source/build inputs also match the post-ICE four-architecture build capsule; the OS-entropy credential fix remains present. No concrete installer weakness was found, and replacing the existing installation owner with another downloader would add unnecessary machinery. These checks establish scoped contract and byte provenance—not a complete transitive cryptographic audit, fresh advisory scan, reproducible compiler build, or replay of absent original toolchain archives. Existing audit limitations, exact-head CI, and the separately stated physical-Watch limitation retain their own dispositions. |
Resolve the shared WebSocket fixture conflict by retaining main's canonical FIFO owner and the separately reviewed cancellation fence. Remove this branch's redundant receive-gap regression and obsolete one-shot emitter. Native Watch media and Rust inputs remain unchanged. Keep main's Gateway compression/payload handoff, expiry cleanup, and CI checkout-owner repair. The integration review is clean; the cancellation regression and its three native controls pass. Current-base Gateway and provider validation remains a landing checkpoint rather than being inferred from older binaries.
Merge main to resolve the native source inventory conflict, retaining both generated entries. Install the existing pinned Watch Rust toolchain before both iOS Periphery consumers build the embedded Watch target. Keep scan failure propagation and unused-code policy unchanged.
Remove the unused audio-format result through the audio, media-session and controller path. Periphery exposed obsolete fields in a value the sole caller discarded; activation, cancellation and codec policy stay unchanged. Include the separately reviewed Apple fixture synchronization fixes from #138207 while that prerequisite lands. No Gateway runtime, protocol, configuration or persistence changes.
Merge main to resolve the generated native inventory conflict while retaining both current dashboard strings and Watch voice strings. Remove the retired fleet callsite from the inventory and preserve the current iOS test project changes. The complete feature diff against the pinned main commit passed independent review. Native inventory verification passed; fresh native, Gateway, live and exact-head CI proof remain required before landing.
Reuse the canonical startup baseline from #138449, terminal-parent QA acknowledgment from #137342, and handle-scoped reclamation fixture from #138481. Keep the Watch, Rust and Gateway/provider production sources unchanged from the verified 907 native and real-provider checkpoint. The four-file delta has a clean independent review. Source binding retains all 148 native inputs, 10 Rust pins and 3,095 Gateway/auth facts; tests and baseline proof remain source-specific. No required check, timeout or size allowance is disabled. Co-authored-by: Ayaan Zaidi <[email protected]>
Use the canonical committed-mutation response owner from #138492 for device remove, rotate and revoke, preserving immediate fencing and scoped teardown. Include the separately reviewed #138625 cleanup fix so a retired caller cannot skip removed-device worker reconciliation. Keep setup/bootstrap on their existing retirement helper and retain the Watch HTTP invalidation owner. Validation: 194 owner, Watch and authorization tests passed with zero skips; fresh scoped managed review found no P0-P3 findings. Full changed checks and new published-head native/Gateway live proof remain separate landing gates.
|
Merged via squash.
|
Summary
Adds opt-in Talk on Watch: native WebRTC/Opus audio travels directly between Apple Watch and the configured voice provider. A separate authenticated Gateway connection carries control, tools and transcripts. The Gateway keeps provider credentials and executes the agent; the iPhone provisions the Watch during setup. Existing phone-mediated Talk to Claw remains available.
Enable iPhone Settings → Apple Watch → Enable Standalone Voice, then use Talk on Watch → Start. The Watch needs a secure, reachable Gateway endpoint and a supported Gateway-controlled WebRTC provider. Opening the view does not start microphone capture. See standalone setup and limits and Talk mode.
Implementation
Each call and connection attempt owns its audio, transport, setup and cleanup. Cancellation fences admission immediately, late callbacks cannot revive a retired attempt, and a replacement waits for prior audio cleanup. Separate node and read/talk operator grants keep the phone bearer and provider credentials off the Watch.
The pinned native engine handles ICE, DTLS and SRTP; Network.framework supplies UDP, and AVAudioEngine/native Opus handle capture and playback. ICE credentials use OS entropy. Address resolution runs off the media queue, and one bounded address plan supplies matching ICE and socket endpoints. Incoming Opus has a one-frame reorder window, with packet-loss and late-packet handling that prevents stale speech replay. Recoverable provider notices remain visible; transport failures and explicit closure end the attempt.
The four Watch platform-metadata regressions now live beside the metadata owner. This preserves their exact inputs and assertions while allowing main's independent metadata-suite extraction and suspension fix to merge normally.
Verification
Current head: 334fefc, tree 2779581cb54203f967b6998c9ffdff458e0883bf.
b40e52ec32ac5de54e752dbcf31084eba461047b.The fresh native capsule discloses three observation/test differences and verifies the actual linked inputs. A verification-only timeout was recovered by batching immutable Git reads, preserving every comparison and both failed receipts; no rebuild or test assertion was changed. Local filesystem pressure also interrupted post-test dependency scans: both source trees were fully reverified, while the original dependency bindings remain the evidence for those static test runs. The fresh Gateway runtime separately verified all 37,867 source facts, all 104,949 original dependency facts, 622 classified generated additions and 14,030 runtime products. Two builds hit their unchanged 1,800-second budget under disk pressure; the successful normal build reused only canonical completed caches, with failed staging excluded. No timeouts, assertions or build phases were weakened.
The fresh native/provider episode on 334fefc passed one test and exactly one provider call. It decoded 389 Opus packets / 373,320 PCM frames, with positive RMS, zero decode errors and acknowledged input transcription. Native Opus and network RTP admissions both measured 353. Operator-grant revocation was accepted, the old grant was rejected, control closed with 4001, and the same provider call received hangup HTTP 200, completing 254.946 ms after the action began and before fixture cleanup. This is causal provider teardown, not emergency fixture cleanup credited as success. Provider acknowledgment is not a measurement of instantaneous physical silence. Historical rotation and same-Watch replacement evidence remains separately scoped.
The first receiver run had 22 passes and one unexpected normal WebSocket close during worker-handshake rejection; the unchanged retry passed 23/23. The first macOS CI attempt failed while waiting for initial Cron fixture text, before the replacement assertion; the targeted retry passed unchanged. Both failures remain recorded diagnostic follow-ups, not claimed code fixes. The 439-test total counts the receiver cases once.
The final cleanup verified ten owned groups absent, both loopback ports free, Simulator deletion and data removal, and no broker cleanup errors. All 104 products and 148 compiled inputs remained bound. Exact-credential scanning found zero hits in 391 retained files; private key/token copies and the task credential window were deleted. Final combined proof SHA-256:
b828864c02bd14697c8067afd298ea0415dda6ef0d6a1572ed666892c6031211.Limits and follow-ups
Physical full-flow and endurance testing is deferred with the maintainer's acceptance because no connected physical Watch is available. Simulator/provider proof does not establish microphone-to-speaker behavior, the complete active-call UI, wrist-down operation, radio handoff, interruptions, battery or thermal behavior.
The peer must support ICE-lite over UDP. Two recoveries reuse the current call; terminal Try Again starts a new call. The provider adapter has a 30-minute active-session lease; seamless rollover and multi-hour continuity are not implemented. Failed provider cleanup is retained in memory.
Named follow-ups: physical-device and real DNS64/NAT64 acceptance; the upstream SRTCP received-index replay-window investigation; the unusual SQLite backup identifier; committed-device-removal diagnostics after requester retirement; and an inherited Gateway Talk close-tail ordering gap requiring a held-work reproduction. None is claimed fixed by this feature. Direct pinned-dependency inspection is recorded in the dependency audit.
Latest review disposition
The current ClawSweeper review establishes no code or security findings. Its first and third pre-merge items and optional rank-up move are addressed by the newly rebuilt Gateway/native/provider checkpoint above. For the reviewer-environment limitation reopening dependencies, the maintainer accepts the already-recorded direct pinned-source audit and skips a redundant reopening in that environment: the ten RTC inputs and linked archive are unchanged and reverified. This does not claim the automated reviewer reopened them or constitute a complete cryptographic audit.
Supporting repairs and release-note context
The 22 supporting task PRs are already merged: #135697, #135765, #135789, #135795, #135904, #135961, #136161, #136307, #136335, #135796, #136273, #136522, #137519, #137463, #137636, #138022, #138045, #138207, #138481, #138593, #138598 and #138625. These include provider retirement, shared Talk ownership, delivery journals, authority fencing and the separately verified CI/fixture repairs. Contributor credit remains in those PRs and their landed commits.
This feature adds no further SQLite schema or Gateway protocol-version change. The separately landed phone/Watch delivery journals own their app-local migrations. Release-note intent: opt-in standalone Apple Watch realtime voice with native WebRTC/Opus, Gateway-owned agent authority, visible controls and bounded cancellation/recovery. The complete diff is 62 files, +19,050/−567. Runtime production is +3,205/−222 (net +2,983); test/support is +1,747/−280 (net +1,467). Build/config, generated files, lockfile and notices are counted separately. Production growth implements the native RTC/audio ownership boundary and standalone capability; absorbing it into the existing text-only companion flow would not provide direct Watch audio. The final test relocation changes production by zero lines. OpenClaw changelogs remain release-generated.
Setup UI
Inspected synthetic-only normal-launch Watch Simulator captures: