fix: persist queued iOS watch replies#100031
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 11:44 AM ET / 15:44 UTC. Summary Reproducibility: yes. from source inspection. Current main accepts Watch quick replies into process-local arrays in WatchReplyCoordinator, so queued replies and dedupe state can be lost if the iOS process is suspended or terminated before delivery; I did not run a physical Apple Watch reproduction. Review metrics: 3 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Resolve the current-main conflicts while preserving the QA-lab serialization fix, drop the normal-PR CHANGELOG.md edit, keep the gateway-scoped Watch outbox shape, rerun exact-head iOS/watch validation, and add real Watch/WatchConnectivity proof or an explicit maintainer proof override. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection. Current main accepts Watch quick replies into process-local arrays in WatchReplyCoordinator, so queued replies and dedupe state can be lost if the iOS process is suspended or terminated before delivery; I did not run a physical Apple Watch reproduction. Is this the best way to solve the issue? Mostly yes for the Watch code shape: using one gateway-scoped durable outbox is the right boundary for this bug. It is not the best merge artifact until current-main conflicts, QA serialization preservation, release-owned changelog churn, and real Watch proof or maintainer override are resolved. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a308e3b83429. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (9 earlier review cycles; latest 8 shown)
|
bd81646 to
3252557
Compare
ade4304 to
f978db8
Compare
|
Land-ready review complete for What changed:
Proof:
Known gap: no physical Apple Watch round-trip was available. The separate iOS Periphery workflow reports the pre-existing unused |
f312a74 to
286d0b9
Compare
|
Thanks @NianJiuZst — the durable Watch reply work has landed through replacement PR #100372 as 70f2bef6b4cf04792f5f15fc12a9fafafa5771cc. GitHub auto-closed this PR when its contributor branch briefly matched |
What Problem This Solves
iOS accepted Apple Watch quick replies into memory and could lose them if the app was suspended or terminated before delivery. Replies also lacked a durable source-gateway binding, so reconnects and gateway switches could route stale actions incorrectly.
Why This Change Was Made
Watch chat messages and quick replies now share one durable, gateway-scoped outbox. Every accepted message is persisted before network delivery, uses its stable command/reply ID as the
chat.sendidempotency key, retries bounded transient failures, and is removed only after acknowledged success or a permanent invalid request.The notification payload carries its source gateway through watchOS and mirrored iOS actions. Persisted prompt-to-gateway routes support released Watch builds that omit the new field; unresolved legacy prompts are dropped instead of guessed. Bounded delivered-message tombstones persist across iPhone restarts so delayed WatchConnectivity fallbacks stay deduplicated.
User Impact
Watch replies survive offline periods, process restarts, and transient gateway failures without creating duplicate agent turns. Replies cannot cross to a newly selected gateway, while older Watch app versions remain compatible for prompts created by the updated iPhone app.
Evidence
xcrun swiftc -parseacross all changed iOS and watchOS Swift filesswiftformat --lint --config config/swiftformatacross changed app sourcesrun_3afe370a8d62:pnpm native:i18n:checkandpnpm check:changedpassedb18c5af174717e965ce0ee13d9ce6f90ec81a55c