Repository navigation
fix: recover saved peer updates before admitting their turns - #174203
Merged
Merged
Conversation
Reconcile orphaned receiver custody through the existing recovery owner before agent admission touches the session row. Retain exact-session, live-writer, worker-placement and command-claim checks, plus the restored registry gate. Main 9215eac reproduces all five lost deliveries; the parent of #174134 passes the unchanged cold-restart regression. All 66 focused tests pass with maxWorkers=1 (227.07s wrapper, including runtime build; native case 40.20s). Core types, targeted lint/format and independent P2 review pass. Release-note context: accepted peer updates recover across startup ordering without manual resend; cancelled/reset/revoked sources remain blocked.
Contributor
|
🦞👀 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. |
steipete
marked this pull request as ready for review
October 16, 2026 12:18
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 17, 2026
…w#174203) Reconcile orphaned receiver custody through the existing recovery owner before agent admission touches the session row. Retain exact-session, live-writer, worker-placement and command-claim checks, plus the restored registry gate. Main 78c0e92 reproduces all five lost deliveries; the parent of openclaw#174134 passes the unchanged cold-restart regression. All 66 focused tests pass with maxWorkers=1 (227.07s wrapper, including runtime build; native case 40.20s). Core types, targeted lint/format and independent P2 review pass. Release-note context: accepted peer updates recover across startup ordering without manual resend; cancelled/reset/revoked sources remain blocked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes accepted peer updates remaining undelivered after a Gateway restart when replay starts before the receiver's interrupted work has been reconciled.
User Impact
Saved
sessions_sendupdates recover once, in order. Cancelled inputs stay cancelled, and reset or permission-revoked sources remain blocked. The original session and current authorization remain authoritative.Why This Change Was Made
#174134 correctly waits for restored subagent authority before main-session recovery. That exposed an admission gap: peer replay can reach an orphaned receiver first, touch its row, then fail with
SESSION_WORK_START_CHANGEDbecause its old run has no recovery cycle.Agent admission now uses the existing orphan-reconciliation owner before touching that receiver. The owner preserves its live-writer, exact-session, and worker-placement checks. The startup readiness change and strict command claim guard remain intact. There is no new queue, retry, timer, schema, configuration, or permission change.
Release-note context: saved peer updates now recover across this startup ordering without requiring a manual resend.
Evidence
9215eace2fb2reproduces the same failure. A temporary stack diagnostic pins all five failures toclaimAgentCommandRecoveryOwner; the diagnostic was removed.8b0908f63429passes the unchanged cold-restart test (90.35s Vitest). The PR's startup-order change is retained.gateway.sessions-send-recovery.test.ts,session-send-recovery.test.ts, andagent-command-recovery-owner.test.ts, with--maxWorkers=1. Wrapper wall: 227.07s, including an 88.5s runtime rebuild. The real Gateway case took 40.20s and verifies five ordered deliveries, cancelled/reset/revoked exclusions, retained blocked-input notices, and no duplicates after a second restart. Every existing assertion is unchanged.Broad proof belongs to this PR's CI. No CI dispatch or rerun was requested.