Repository navigation
fix(agents): fence restart recovery to gateway lifecycle - #119776
Merged
Merged
Conversation
vincentkoc
marked this pull request as ready for review
August 5, 2026 23:44
Member
Author
|
Maintainer lifecycle review complete for exact head |
Member
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 6, 2026
vincentkoc
added a commit
to VACInc/openclaw
that referenced
this pull request
Aug 6, 2026
…cope * origin/main: (24 commits) fix(backup): skip transient gateway lock databases (openclaw#119782) test(agents): use canonical auth session fixtures (openclaw#119821) fix(memory): keep QMD file hints after stale docid misses (issue openclaw#113041) (openclaw#113515) test(doctor): align fast-path repair contracts (openclaw#119812) perf(agents): index subagent recovery ownership (openclaw#119793) fix(gateway): keep chat startup off catalog discovery (openclaw#119742) fix(test): keep TUI PTY suites in their owner lane (openclaw#119787) docs: correct dashboard auth precedence (openclaw#119785) docs: document control ui owner handoff fix: grant host-authorized control ui owner access fix(worktrees): preserve registered roots during orphan cleanup (openclaw#119709) fix(matrix): prevent shared client key collisions (openclaw#119667) fix(diagnostics-otel): propagate exported span context (openclaw#112283) fix(worker): isolate state observer failures (openclaw#117507) fix(qa): attest realized profile executions (openclaw#119761) fix(gateway): finish successful sessions after timestamp races (openclaw#119752) fix(agents): fence restart recovery lifecycle (openclaw#119776) fix(ui): preserve chat history and active run timing (openclaw#119729) improve(ollama): reduce inactive startup cost (openclaw#119745) improve(gateway): defer inactive plugin runtime imports (openclaw#119733) ...
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 an issue where interrupted subagent recovery could continue after the Gateway lifecycle that started it had retired, allowing stale restart work to dispatch through the replacement lifecycle.
Release note: Fixes a race where interrupted subagent recovery could dispatch through a retired Gateway lifecycle after restart.
Why This Change Was Made
The root cause was split across the restart-recovery and run-manager owner boundary: recovery's source-current predicate checked row and session identity but omitted its captured Gateway lifecycle generation, while the durable
reserved -> attemptedtransition accepted a supplied stale generation. That let stale recovery work stamp the replacement generation after an await.The canonical fix carries the captured lifecycle through recovery admission and into
markLaunchAttempted, while the run manager rejects a stale supplied generation before mutating or persisting the at-most-once receipt.User Impact
When the Gateway lifecycle rotates during transcript recovery, the stale recovery returns as handled without reserving a launch, marking an attempt, or dispatching. The active lifecycle remains responsible for any subsequent recovery.
There are no config, schema, dependency, performance, index, or scheduling changes.
Evidence
Exact commit:
67beead1b7f205d6f63ae387c1f6b2bc6a7c8d60Production delta:
+3/-1, net+2; tests:+86Restart-recovery focused suite:
27/27Direct run-manager stale-generation contract:
1/1Orphan restart integration suite:
8/8Sibling proof covers both the durable run-manager transition and cold-restart orphan recovery behavior.
Exact-head Blacksmith
core, coreTestscheck passed: https://github.com/openclaw/openclaw/actions/runs/31056517970Structured branch autoreview: no P0/P1 findings
This PR is AI-assisted.
I understand what the code does.
I ran autoreview and addressed all actionable findings.