Repository navigation
fix(gateway): continue on Gateway with pending offline results - #147390
Conversation
|
landpr-approve-admin-merge |
|
🦞👀 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 maintainer review before merge. Reviewed September 13, 2026, 4:47 PM ET / 20:47 UTC. ClawSweeper reviewWhat this changesAllows confirmed abandonment of offline-device sessions with pending workspace results, restores interrupted abandonment during startup, and adds recovery-through-deletion regression coverage. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main and v2026.9.4. The reviewed patch preserves ordinary-move safeguards and addresses the reported recovery failure without introducing a blocking defect. Priority: P0 Review scores
Verification
How this fits togetherGateway placement management decides whether a session runs locally or on a worker device. It coordinates move requests, pending workspace results, and worker cleanup before allowing subsequent conversation turns. flowchart TD
A[Confirmed recovery request] --> B[Validate exact offline device]
B --> C[Persist abandonment decision]
D[Pending workspace result] --> C
C --> E[Retire result and worker authority]
E --> F[Resume session on Gateway]
E --> G[Retain remote cleanup until acknowledged]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +424. Total +431 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep the existing Continue on Gateway recovery action owner-fenced and usable with pending results, while preserving ordinary reconciliation and deferred physical-device cleanup. Do we have a high-confidence way to reproduce the issue? Yes, from source: an exact-source abandonment request with a pending result reaches the unconditional drain rejection on current main; the linked report supplies the matching live failure. This review did not execute current main. Is this the best way to solve the issue? Yes. Passing the existing drain allowance only for confirmed abandonment and letting its durable owner control recovery is a narrow repair that preserves ordinary-move safety. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b4a89e8ad2bd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Thanks @MasterSwords1! Proof: Confirmed offline-device recovery returns to local use, completes a fresh reply, and deletes the session with a readable transcript archive. Ordinary moves still preserve pending results.
|
…law#147390) Related: openclaw#146012. Supersedes openclaw#146205 by @MasterSwords1. Thanks @jalehman for the report. The contributor's four commits retain their authorship. ## What Problem This Solves **Continue on Gateway** fails after confirmation when an offline device session has a pending workspace result, leaving the session blocked. ## User Impact Confirmed abandonment returns the session to local use. A fresh turn completes, and normal deletion archives its transcript. Ordinary moves still preserve pending results. Unsynced device work can be lost, as the existing confirmation warns. ## Why This Change Was Made The durable move intent is the single owner of the abandonment decision. It permits the pending-result drain; result recovery yields to it, and existing teardown retires the exact result and claim. The placement coordinator orders moves against recovery. No schema, migration, configuration, protocol, or dependency changes. Tests now cover the full user flow and explicit fixture cleanup, removing overlapping handler tests and shutdown-error suppression. The correction commits remove 269 net lines from the contributor version. Remaining growth supplies three real Gateway regressions. ## Evidence Real Gateway capture, using the same exact-source `sessions.move` request with `target: {kind: "gateway"}` and `abandonSource: true`: | Main `a9d0dc39c9e8` | This change | | --- | --- | | `UNAVAILABLE: Cannot drain session … with a pending cloud workspace result` | `ok: true`, `placement.state: local` | | Original claim and pending result remain | Pending result and move intent gone; old claim/result rejected | | Recovery action blocked | One fresh reply: `RECOVERED_SESSION_OK`; deletion returns `deleted: true` with a readable transcript archive | Commands: `pnpm openclaw gateway call sessions.move`, then `chat.send`, `agent.wait`, `chat.history`, and `sessions.delete`. The ordinary-move negative case still rejects. The old device cleanup record remains until its exact stop is acknowledged. Fresh two-parent merge proof: candidate `0801a11ab50c` + main `3eafa82bb6c6` → `ec30ae86f2439`. The repository CI test runner (`node --import tsx scripts/ci-run-node-test-shard.mts`) passed **146 tests in 7 files**, using the Gateway core, server, and isolated-server configurations. Coverage includes move/store ownership, forced abandonment, recovery coordination, startup, fresh turns, and archived deletion. Formatting, changed-file lint, line limits, assertion safety, unused exports, and architecture checks pass. Typechecking remains with CI. Startup cases prove **database reopen plus in-process Gateway startup**, including an already-failed placement with a different error. No physical-device shutdown or operating-system crash claim. ## Reviewed proof scope The read-only review found no blocking source or test correction at `0801a11ab50cdf94e514951b36b68793bb58a0e5`. - The real Gateway proof covers confirmed abandonment, one fresh reply, and exact-session deletion with a readable transcript archive. Ordinary moves still reject the pending result. - The standalone capture used the same three production blobs as the final head. All three maintained full-flow cases also passed on merge `ec30ae86f24390d69e7af606aa7c50cc9683107a`, with candidate `0801a11ab50cdf94e514951b36b68793bb58a0e5` and main `3eafa82bb6c63303b7d4341ce8cbe82b61b98c9c` as parents. The selected suite passed 146 tests in seven files. - Recovery coverage means database reopen plus in-process Gateway startup, including an already-failed placement with a different error. It does not claim a browser click, an operating-system crash, or physical-device shutdown. - The old device cleanup record remains until its exact stop is acknowledged. The tests use an explicit synthetic acknowledgement only during teardown. - The original contributor's four commits retain their authorship. Credit remains with @MasterSwords1 for openclaw#146205 and @jalehman for openclaw#146012. Closure of openclaw#146205 remains a landing step. ## Consumers Confirmed `sessions.move` and startup recovery share the durable abandonment decision. Fresh chat turns and session deletion consume the resulting local placement; ordinary moves retain their existing pending-result guard. Session-change events refresh the existing placement projection. Co-authored-by: MasterSwords1 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
@obviyus — current-owner coordination for the real Gateway regression introduced in #147390 (preserving the original contributor attribution). The existing #149581 CI run 35047985200 / job 104642118377 now blocks that PR and dependents #149585/#149587 with three failures in
The fixture is unchanged on current main: Git blob Please identify any already-active repair/checkout and take the smallest follow-up through review, the real Gateway cases, and required CI/native landing, or explicitly delegate a bounded repair if you are no longer its writer. Keep actual shutdown/child settlement, one fresh reply, pending-result retirement, archived deletion, and mutation-authority assertions; no timeout increase, fake success, or production guard weakening. We will consume the canonical correction, not publish a competing fixture rewrite. No test rerun, dependency install, gateway source edit, or duplicate repair PR was started for this handoff. The saved failing log was reused (SHA256 |
Keep teardown inside the original 90-second body deadline and join it before the next case acquires shared state. Preserve the fixture scenarios and assertions introduced by obviyus in #147390. Add a source-bound cancellation regression, forward context-local expect, and use the existing typed deferred owner.
…49668) Keep teardown inside the original 90-second body deadline and join it before the next case acquires shared state. Preserve the fixture scenarios and assertions introduced by obviyus in openclaw#147390. Add a source-bound cancellation regression, forward context-local expect, and use the existing typed deferred owner.
Related: #146012. Supersedes #146205 by @MasterSwords1. Thanks @jalehman for the report. The contributor's four commits retain their authorship.
What Problem This Solves
Continue on Gateway fails after confirmation when an offline device session has a pending workspace result, leaving the session blocked.
User Impact
Confirmed abandonment returns the session to local use. A fresh turn completes, and normal deletion archives its transcript. Ordinary moves still preserve pending results. Unsynced device work can be lost, as the existing confirmation warns.
Why This Change Was Made
The durable move intent is the single owner of the abandonment decision. It permits the pending-result drain; result recovery yields to it, and existing teardown retires the exact result and claim. The placement coordinator orders moves against recovery. No schema, migration, configuration, protocol, or dependency changes.
Tests now cover the full user flow and explicit fixture cleanup, removing overlapping handler tests and shutdown-error suppression. The correction commits remove 269 net lines from the contributor version. Remaining growth supplies three real Gateway regressions.
Evidence
Real Gateway capture, using the same exact-source
sessions.moverequest withtarget: {kind: "gateway"}andabandonSource: true:a2b2391e3538UNAVAILABLE: Cannot drain session … with a pending cloud workspace resultok: true,placement.state: localRECOVERED_SESSION_OK; deletion returnsdeleted: truewith a readable transcript archiveCommands:
pnpm openclaw gateway call sessions.move, thenchat.send,agent.wait,chat.history, andsessions.delete. The ordinary-move negative case still rejects. The old device cleanup record remains until its exact stop is acknowledged.Fresh two-parent merge proof: candidate
0801a11ab50c+ main6f58faf3eb0d→ec30ae86f2439. The repository CI test runner (node --import tsx scripts/ci-run-node-test-shard.mts) passed 146 tests in 7 files, using the Gateway core, server, and isolated-server configurations. Coverage includes move/store ownership, forced abandonment, recovery coordination, startup, fresh turns, and archived deletion. Formatting, changed-file lint, line limits, assertion safety, unused exports, and architecture checks pass. Typechecking remains with CI.Startup cases prove database reopen plus in-process Gateway startup, including an already-failed placement with a different error. No physical-device shutdown or operating-system crash claim.
Reviewed proof scope
The read-only review found no blocking source or test correction at
0801a11ab50cdf94e514951b36b68793bb58a0e5.ec30ae86f24390d69e7af606aa7c50cc9683107a, with candidate0801a11ab50cdf94e514951b36b68793bb58a0e5and main6f58faf3eb0d45cd78a198ce2d838d601deceec5as parents. The selected suite passed 146 tests in seven files.Consumers
Confirmed
sessions.moveand startup recovery share the durable abandonment decision. Fresh chat turns and session deletion consume the resulting local placement; ordinary moves retain their existing pending-result guard. Session-change events refresh the existing placement projection.