Repository navigation
fix: resume interrupted peer work after gateway restarts - #176697
Conversation
Preserve admitted operator recovery sources for peer follow-ups while keeping internal delivery boundaries. Route automatic peer results through durable communication admission and retain optional-reply semantics. Keep concurrent history reconciliation consistent and revisit startup orphans after temporary controller owners release, without taking over live, completed, stopped, or replaced work. Verified with focused regressions, restart and Stop process controls, two real-model Chromium SIGKILL/restart runs, type checks, lint, and independent review. Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 5aee73d0-1bd6-44e3-a024-fe4d4af4a30a
|
🦞👀 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 changes before merge. What this changesThis PR resumes interrupted peer requests and returned results through existing session recovery owners while preserving Stop and authority checks. Example: agent:main:peer-restart-target completes a command before the Gateway receives SIGKILL.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this PR provides a useful recovery repair, but two diff-caused test failures block merge; the earlier findings are resolved. Priority: P1 Before merge
Findings
Agent review detailsHow this fits togetherSession tools admit peer messages into the Gateway’s pending-input owner, which persists recovery facts and dispatches unfinished work after restart. flowchart TD
A[Requesting session] --> B[Communication admission]
B --> C[Durable pending input]
C --> D[Peer execution]
D --> E[Accepted result]
E --> C
C --> F[Gateway restart recovery]
F --> G[Current authority and session checks]
G --> D
Technical reviewBest possible solution: Retain the existing recovery owners and repair the authenticated peer fixture and ownership-loss regression without weakening authorization or cancellation assertions. Do we have a high-confidence way to reproduce the issue? Current-main source shows returned results bypassing durable communication admission, and the PR records restart controls for the repaired behavior; exact-head CI independently reproduces two validation failures. Is this the best way to solve the issue? The repair appropriately reuses communication admission, pending-input persistence, and session-controller recovery; its remaining defects are focused test integration problems. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6e4883fca44e. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +282, Tests +1778, Docs +26. Total +2086 across 35 files. Added test files: 2. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed October 18, 2026, 11:50 PM ET / October 19, 2026, 03:50 UTC (Revision 4). |
Preserve cancellation while controller cleanup is retained, recheck captured owners, and align restart proof fixtures with CI ownership and timeout contracts. Co-authored-by: steipete <[email protected]>
Keep requested replies bound to their accepted request instead of requiring new reverse-direction communication grants. Preserve exact endpoint and live continuation checks, including retained result recovery. Cover receive-only and send-only peers and automatic recovery revocation. Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 9a2eea6f-d0ab-4df7-9022-bf01a687e625
Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: b46863ce-7762-493b-9213-10d76d1ef610
Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: db018862-f35f-4237-849a-7a732db4185a
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Keep final-response authority checks and publication ordering while distinguishing a denied response from unfinished runtime disposal. Verify rejection and cleanup explicitly, preserve recovery callback invocation, and align requester and UI proof fixtures. Co-authored-by: steipete <[email protected]>
Merge main's canonical execution-cleanup repair and update the real-process controls to prove automatic authenticated recovery, terminal cancellation, and live permission checks. Co-authored-by: steipete <[email protected]>
Co-authored-by: steipete <[email protected]>
The input-custody proof must reject unexpected cleanup failures, but final publication can already have settled. Keep the exact allowed denial and retain the dedicated execution-cleanup regressions. Co-authored-by: steipete <[email protected]>
Integrate the CI base and compare the captured backend handle, not its attachment wrapper. Preserve exact-owner checks across queued-to-running publication. The existing real-reply regression is red on the integrated base and green with this fix. Co-authored-by: steipete <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…6697) * fix(sessions): resume admitted peer work after gateway restarts Preserve admitted operator recovery sources for peer follow-ups while keeping internal delivery boundaries. Route automatic peer results through durable communication admission and retain optional-reply semantics. Keep concurrent history reconciliation consistent and revisit startup orphans after temporary controller owners release, without taking over live, completed, stopped, or replaced work. Verified with focused regressions, restart and Stop process controls, two real-model Chromium SIGKILL/restart runs, type checks, lint, and independent review. Co-authored-by: steipete <[email protected]> * fix: resume interrupted peer work after gateway restarts Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 5aee73d0-1bd6-44e3-a024-fe4d4af4a30a * fix(sessions): keep stopped work out of restart recovery Preserve cancellation while controller cleanup is retained, recheck captured owners, and align restart proof fixtures with CI ownership and timeout contracts. Co-authored-by: steipete <[email protected]> * fix(sessions): preserve accepted peer reply authority Keep requested replies bound to their accepted request instead of requiring new reverse-direction communication grants. Preserve exact endpoint and live continuation checks, including retained result recovery. Cover receive-only and send-only peers and automatic recovery revocation. Co-authored-by: steipete <[email protected]> * Publish openclaw/delta-krill-2 Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 9a2eea6f-d0ab-4df7-9022-bf01a687e625 * Publish openclaw/delta-krill-2 Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: b46863ce-7762-493b-9213-10d76d1ef610 * Publish openclaw/delta-krill-2 Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: db018862-f35f-4237-849a-7a732db4185a * test: exercise session key precedence with accepted dispatch Co-authored-by: steipete <[email protected]> * Publish openclaw/delta-krill-2 Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 7921627c-e41a-4397-b3b0-7314ebf1e3df * Publish openclaw/delta-krill-2 Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 80568c1f-17da-4d70-afc1-4c69a6a5ff44 * Publish openclaw/delta-krill-2 Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 82344178-4568-4f6b-b557-aec5587ac138 * fix(gateway): release completed custody after response denial Keep final-response authority checks and publication ordering while distinguishing a denied response from unfinished runtime disposal. Verify rejection and cleanup explicitly, preserve recovery callback invocation, and align requester and UI proof fixtures. Co-authored-by: steipete <[email protected]> * test: include task PR fixture in UI ownership expectations Co-authored-by: steipete <[email protected]> * test: allow completed custody cleanup after caller revocation The input-custody proof must reject unexpected cleanup failures, but final publication can already have settled. Keep the exact allowed denial and retain the dedicated execution-cleanup regressions. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]>
What Problem This Solves
Fixes: admitted peer follow-ups and returned results can remain interrupted after a Gateway restart, even though their original session and unfinished work still exist.
User Impact
Peer work resumes automatically in the original session after restart without requiring a manual Resume action or repeating a completed command. Requested replies still arrive when reverse-direction sends are disabled. Stop, cancellation, access revocation, and replaced-session boundaries remain enforced. No configuration or database-schema migration is required.
Why This Change Was Made
Preserve the admitted operator recovery source, route automatic peer results through the existing durable communication owner, and retain their optional-reply context. Requested replies use authority captured from the accepted request rather than a new reverse-direction send permission. Exact endpoint and current cancellation/access checks still apply.
Make concurrent history reconciliation return consistent interrupted state, and revisit startup orphans after a temporary controller owner releases them. Recovery keeps the original startup cutoff and live ownership checks. Explicitly stopped claims and operations retain cleanup custody but cannot be captured or revalidated as recoverable work.
This does not fabricate receipts for historical deliveries already missing evidence or modify the running Team Gateway.
Evidence
Validated tree:
3dad52e17a34de685e32ddae3b04842549bc2111, integrating main1f7b2f1c6f0075fb90946615d6bab6b96e02f593and its canonical cleanup repair #176912.The process controls now prove automatic recovery under current shared-secret owner authorization, rather than requiring a new manual turn. This PR does not modify the live Team Gateway.
no_active_run; comparing the actual backend handle restores queued-to-running steering without weakening ownership checks. Relevant Talk tests, all 8 process controls and the live browser proof pass on the integrated source.3dad52e17a34de685e32ddae3b04842549bc2111.Requested by Peter Steinberger; co-author credit is preserved in the implementation commits.
Worked on by
Work sessions