Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 3:35 PM ET / 19:35 UTC. Summary PR surface: Other +1020. Total +1020 across 8 files. Reproducibility: yes. from current-main source and the supplied negative-control evidence: a dropped acknowledgement can cause the old durable outbox path to dispatch the same command again. I did not independently execute the scenario during this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Rebase this complete branch, attach redacted exact-head Testbox or emulator proof for dropped acknowledgement, restart recovery, explicit Retry, and Room v2→v3 upgrade behavior, then close the narrower replacement as superseded. Do we have a high-confidence way to reproduce the issue? Yes, from current-main source and the supplied negative-control evidence: a dropped acknowledgement can cause the old durable outbox path to dispatch the same command again. I did not independently execute the scenario during this read-only review. Is this the best way to solve the issue? Yes. Typed gateway outcomes, serialized restart recovery, gateway-scoped retry transitions, and durable persistence barriers address the defect at the Android transport/outbox boundary without creating a second retry source of truth. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1bcc4c5e7063. Label changesLabel justifications:
Evidence reviewedPR surface: Other +1020. Total +1020 across 8 files. View PR surface stats
What 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 (1 earlier review cycle)
|
8f9dca2 to
d34e4ac
Compare
d34e4ac to
8b27ba8
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(android): require explicit retry after interrupted sends This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof after final maintainer fixups. Thanks @NianJiuZst for identifying the interrupted-send replay risk and supplying the initial persistence regression. Best-fix verdict: the final patch carries the Gateway's typed delivery outcome into one closed Android outbox state machine. A request known not to be enqueued remains automatically retryable; a definitive Gateway rejection consumes the bounded retry budget; a post-dispatch timeout/disconnect or process-interrupted Exact proof at head
Known gap: no physical-device or Play Store smoke. The exact installed API 36 flow covers the affected user-visible lifecycle, reconnect, persistence, Refresh, and Retry behavior. No remaining merge blocker. |
8b27ba8 to
4f06021
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(android): require explicit retry after interrupted sends This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
4f06021 to
afb654a
Compare
15ee192 to
932f4ed
Compare
|
Merged via squash.
|
…f retirement Every chat send is journaled to the per-gateway Room outbox before any network attempt, so process death always has one durable recovery owner. Rows survive gateway ACKs as 'accepted' and retire only once the turn is proven in canonical chat.history by idempotency key; ambiguous outcomes (lost ACK, kill mid-send, gateway restart before the transcript write) park as delivery-unconfirmed for explicit retry, per the fail-closed model #103273 landed. An unproven accepted head briefly holds only its own session's queue, and retrying a parked head re-orders still-queued successors behind it. Offline sends now accept picked images and voice notes; attachment bytes persist as chunked BLOBs (512 KB chunks, 8 MB per message, 48 MB per gateway) admitted and retired atomically with their row. Pre-hello 'main' rows pin to the canonical session at first dispatch so later default-agent changes cannot retarget captured input; slash commands are connection-gated by a persisted epoch (legacy queued command rows migrate to a never-matching sentinel) and never auto-replay across reconnects. The Room store moves to schema v4 on top of v3's data-parking migration, adding the epoch column and attachment tables while preserving queued rows. The queued->sending claim is an atomic compare-and-set shared by the direct dispatch and the flush loop, the direct path waits for the startup recovery sweep before claiming, and failed reconnect attempts republish outbox rows so queued sends stay visible on offline cold starts. Proof: 1151 Android unit tests and :app:ktlintCheck green (new migration, storage, and controller coverage for admission, restarts, claims, pinning, gating, ordering, and byte round-trips); a live emulator scenario on the pre-integration build queued text+image offline, survived force-stop plus a device reboot, resent exactly once on reconnect (single <rowId>:user turn in the gateway transcript), and drained the outbox after canonical-history confirmation. Closes #104087.
…f retirement (#104089) * feat(android): durable offline chat with attachments and history-proof retirement Every chat send is journaled to the per-gateway Room outbox before any network attempt, so process death always has one durable recovery owner. Rows survive gateway ACKs as 'accepted' and retire only once the turn is proven in canonical chat.history by idempotency key; ambiguous outcomes (lost ACK, kill mid-send, gateway restart before the transcript write) park as delivery-unconfirmed for explicit retry, per the fail-closed model #103273 landed. An unproven accepted head briefly holds only its own session's queue, and retrying a parked head re-orders still-queued successors behind it. Offline sends now accept picked images and voice notes; attachment bytes persist as chunked BLOBs (512 KB chunks, 8 MB per message, 48 MB per gateway) admitted and retired atomically with their row. Pre-hello 'main' rows pin to the canonical session at first dispatch so later default-agent changes cannot retarget captured input; slash commands are connection-gated by a persisted epoch (legacy queued command rows migrate to a never-matching sentinel) and never auto-replay across reconnects. The Room store moves to schema v4 on top of v3's data-parking migration, adding the epoch column and attachment tables while preserving queued rows. The queued->sending claim is an atomic compare-and-set shared by the direct dispatch and the flush loop, the direct path waits for the startup recovery sweep before claiming, and failed reconnect attempts republish outbox rows so queued sends stay visible on offline cold starts. Proof: 1151 Android unit tests and :app:ktlintCheck green (new migration, storage, and controller coverage for admission, restarts, claims, pinning, gating, ordering, and byte round-trips); a live emulator scenario on the pre-integration build queued text+image offline, survived force-stop plus a device reboot, resent exactly once on reconnect (single <rowId>:user turn in the gateway transcript), and drained the outbox after canonical-history confirmation. Closes #104087. * fix(android): rearm outbox recovery when direct-send state persistence fails * fix(android): keep direct dispatch alive across caller cancellation The direct send's network phase now runs in the controller scope, so a cancelled UI scope (leaving the chat screen mid-send) can no longer strand a claimed row in 'sending' with no user action available; the dispatch completes and settles the row exactly once. Direct-path state persistence failures also re-arm the startup recovery sweep, mirroring the flush path's fail-closed handling. * fix(android): hand claim-persistence failures to the flush lane A direct-send claim that fails to persist no longer reads as a lost race: the admitted row is handed to the flush lane so a healthy connection still delivers it, and the flush path's fail-closed handling owns any repeated storage failure instead of the UI reporting success with no active owner. * fix(android): enforce connection gating and fail-closed parking on every send path The direct dispatch now rechecks a slash command's connection epoch after its durable claim, so a reconnect between admission and dispatch parks the command instead of replaying it on the new connection. Parking a stale gated row only counts once the write persists; a storage failure drops health, re-arms recovery, and halts the flush pass instead of spinning or dispatching the stale row. * fix(android): recognize gateway-acknowledged run ids in outbox ownership checks A chat.send ACK can return a run id that differs from the row's idempotency key (the direct path transfers local run ownership to it). Ownership, in-flight, backlog, and timeout-park checks now consider both ids, so reconciliation can no longer park — and Retry can no longer duplicate — a turn that is still running on the gateway. * fix(android): close remaining ack-ownership and persistence-failure gaps in the outbox Flushed sends acked under a divergent run id now transfer local run ownership like the direct path, so live runs cannot time out and surface spurious errors for delivered turns. A session pin that cannot persist stops the dispatch while the row is still safely queued. Reconcile and timeout parking only report changes their writes actually persisted, failing closed on storage errors. * docs(android): record why acknowledged run ids stay in-memory
…w#103273) * fix(android): require retry after interrupted outbox sends * fix(android): fail ambiguous outbox sends closed Co-authored-by: NianJiuZst <[email protected]> * fix(android): preserve run-id-only acknowledgements * style(android): format outbox assertion * fix(android): fail outbox recovery closed Co-authored-by: NianJiuZst <[email protected]> * test(android): prove dropped ack is not replayed Co-authored-by: NianJiuZst <[email protected]> * fix(android): accept terminal outbox acknowledgements Co-authored-by: NianJiuZst <[email protected]> * fix(android): persist rejected outbox retries Co-authored-by: NianJiuZst <[email protected]> * fix(android): require manual retry after transmitted failures * fix(android): migrate ambiguous outbox rows safely * test(android): import outbox cancellation type * fix(android): limit destructive chat cache migration * fix(android): guard outbox retry transitions * fix(android): reject malformed chat acknowledgements * test(android): type migration bind arguments * test(android): separate migration and replay proof * fix(android): accept admitted outbox acknowledgements * fix(android): preserve gateway health after acknowledged outbox failures * fix(android): stop outbox flush on persistence failure * fix(android): stop outbox flush when claims fail * fix(android): enforce durable outbox barriers * fix(android): coalesce outbox flush requests * style(android): format outbox assertions --------- Co-authored-by: NianJiuZst <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…f retirement (openclaw#104089) * feat(android): durable offline chat with attachments and history-proof retirement Every chat send is journaled to the per-gateway Room outbox before any network attempt, so process death always has one durable recovery owner. Rows survive gateway ACKs as 'accepted' and retire only once the turn is proven in canonical chat.history by idempotency key; ambiguous outcomes (lost ACK, kill mid-send, gateway restart before the transcript write) park as delivery-unconfirmed for explicit retry, per the fail-closed model openclaw#103273 landed. An unproven accepted head briefly holds only its own session's queue, and retrying a parked head re-orders still-queued successors behind it. Offline sends now accept picked images and voice notes; attachment bytes persist as chunked BLOBs (512 KB chunks, 8 MB per message, 48 MB per gateway) admitted and retired atomically with their row. Pre-hello 'main' rows pin to the canonical session at first dispatch so later default-agent changes cannot retarget captured input; slash commands are connection-gated by a persisted epoch (legacy queued command rows migrate to a never-matching sentinel) and never auto-replay across reconnects. The Room store moves to schema v4 on top of v3's data-parking migration, adding the epoch column and attachment tables while preserving queued rows. The queued->sending claim is an atomic compare-and-set shared by the direct dispatch and the flush loop, the direct path waits for the startup recovery sweep before claiming, and failed reconnect attempts republish outbox rows so queued sends stay visible on offline cold starts. Proof: 1151 Android unit tests and :app:ktlintCheck green (new migration, storage, and controller coverage for admission, restarts, claims, pinning, gating, ordering, and byte round-trips); a live emulator scenario on the pre-integration build queued text+image offline, survived force-stop plus a device reboot, resent exactly once on reconnect (single <rowId>:user turn in the gateway transcript), and drained the outbox after canonical-history confirmation. Closes openclaw#104087. * fix(android): rearm outbox recovery when direct-send state persistence fails * fix(android): keep direct dispatch alive across caller cancellation The direct send's network phase now runs in the controller scope, so a cancelled UI scope (leaving the chat screen mid-send) can no longer strand a claimed row in 'sending' with no user action available; the dispatch completes and settles the row exactly once. Direct-path state persistence failures also re-arm the startup recovery sweep, mirroring the flush path's fail-closed handling. * fix(android): hand claim-persistence failures to the flush lane A direct-send claim that fails to persist no longer reads as a lost race: the admitted row is handed to the flush lane so a healthy connection still delivers it, and the flush path's fail-closed handling owns any repeated storage failure instead of the UI reporting success with no active owner. * fix(android): enforce connection gating and fail-closed parking on every send path The direct dispatch now rechecks a slash command's connection epoch after its durable claim, so a reconnect between admission and dispatch parks the command instead of replaying it on the new connection. Parking a stale gated row only counts once the write persists; a storage failure drops health, re-arms recovery, and halts the flush pass instead of spinning or dispatching the stale row. * fix(android): recognize gateway-acknowledged run ids in outbox ownership checks A chat.send ACK can return a run id that differs from the row's idempotency key (the direct path transfers local run ownership to it). Ownership, in-flight, backlog, and timeout-park checks now consider both ids, so reconciliation can no longer park — and Retry can no longer duplicate — a turn that is still running on the gateway. * fix(android): close remaining ack-ownership and persistence-failure gaps in the outbox Flushed sends acked under a divergent run id now transfer local run ownership like the direct path, so live runs cannot time out and surface spurious errors for delivered turns. A session pin that cannot persist stops the dispatch while the row is still safely queued. Reconcile and timeout parking only report changes their writes actually persisted, failing closed on storage errors. * docs(android): record why acknowledged run ids stay in-memory
What Problem This Solves
Fixes an issue where Android could resend a chat command after the app was killed or disconnected after the gateway accepted it but before the local outbox row was deleted.
Why This Change Was Made
Interrupted
sendingrows and post-dispatch unknown outcomes now become visible failed rows with a delivery-unconfirmed reason. Only requests known not to have entered the socket queue and requests definitively rejected by the gateway remain eligible for automatic retry. The existing user-driven Retry action is the only path that can replay an ambiguous command.User Impact
Android no longer silently repeats agent runs or tool side effects after a crash, timeout, or disconnect when durable gateway deduplication is unavailable. Users can inspect, delete, or explicitly retry an affected command.
Evidence
8b27ba8e8f13f0162b29de8ae04fcf6b38a40b9f; tree:9fd8b86ce04d02c43ba05634801f210404c301da.tbx_01kx6ge0n3rg6e8syvh8nryvvvindependently fetched the pull ref, asserted the exact SHA/tree and clean checkout, then passed 37 focused tests across the controller outbox, Room persistence, and a real MockWebServer disconnect/outcome-unknown path.:app:ktlintFormat,:app:ktlintCheck, andgit diff --checkpassed before the final push.AI-assisted: built with Codex.