Repository navigation
fix(subagents): resume restart recovery after retained run cleanup - #175044
Merged
Merged
Conversation
PR #174838 removed broad session-change invalidation, but retained run contexts have no admission-release promise. Command cleanup can release its admission before awaited cleanup clears the run context, leaving a recovery attempt without its next wake. Observe only runtime/agent-run changes for retained owners, and schedule the existing one-second wake once their current ownership ends. Preserve admission-release wakes, bounded deferred retries and effect authority. Unsubscribe on reset and account for release during the recovery read. Extend the existing ownership table with staggered admission/run release. Main reproduces the retained-run failure; #174838's parent passes both original cases. Fixed recovery and sweeper files pass 127 tests with maxWorkers=1 (61.05s and 76.55s wrappers). Targeted types, lint, formatting, docs MDX and isolated P2 review pass. No CI dispatch or rerun.
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 17, 2026 03:22
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
…175044) PR openclaw#174838 removed broad session-change invalidation, but retained run contexts have no admission-release promise. Command cleanup can release its admission before awaited cleanup clears the run context, leaving a recovery attempt without its next wake. Observe only runtime/agent-run changes for retained owners, and schedule the existing one-second wake once their current ownership ends. Preserve admission-release wakes, bounded deferred retries and effect authority. Unsubscribe on reset and account for release during the recovery read. Extend the existing ownership table with staggered admission/run release. Main reproduces the retained-run failure; openclaw#174838's parent passes both original cases. Fixed recovery and sweeper files pass 127 tests with maxWorkers=1 (61.05s and 76.55s wrappers). Targeted types, lint, formatting, docs MDX and isolated P2 review pass. No CI dispatch or rerun.
steipete
added a commit
that referenced
this pull request
Oct 17, 2026
PR #175033 intentionally makes missing-source requester and yielded continuations settle once without inventing operator authority. These restart-fence fixtures instead need an authorized original requester. Reuse prepareSubagentRecoveryFixture before persisting their rows. Keep existing parent identity in the yielded integration case and preserve all wake, stale-batch, delivery, and deadline assertions. Production code and missing-source settlement coverage remain unchanged. Attribution: current main a1ef282 reproduces three matching failures; pre-#175033 cc19e13 passes seven focused cases while already containing #175044. The ownership-release fix is therefore retained. Validation: both full affected files pass all 45 tests under Node with maxWorkers=1 (272.02s Vitest; native SQLite restart/fence coverage). Targeted types, type-aware lint, formatting, and isolated P2 review pass. No CI dispatch or rerun.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 18, 2026
…aw#175186) PR openclaw#175033 intentionally makes missing-source requester and yielded continuations settle once without inventing operator authority. These restart-fence fixtures instead need an authorized original requester. Reuse prepareSubagentRecoveryFixture before persisting their rows. Keep existing parent identity in the yielded integration case and preserve all wake, stale-batch, delivery, and deadline assertions. Production code and missing-source settlement coverage remain unchanged. Attribution: current main a40e1b1 reproduces three matching failures; pre-openclaw#175033 c8f9ee3 passes seven focused cases while already containing openclaw#175044. The ownership-release fix is therefore retained. Validation: both full affected files pass all 45 tests under Node with maxWorkers=1 (272.02s Vitest; native SQLite restart/fence coverage). Targeted types, type-aware lint, formatting, and isolated P2 review pass. No CI dispatch or rerun.
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 interrupted subagent tasks remaining pending after a retained run finishes cleanup.
User Impact
Restart recovery schedules its existing one-second wake when the live run releases ownership, including when its session admission released earlier. Recovery still rereads current state and checks authority before settling the interrupted task or continuing its requester.
Why This Change Was Made
#174838 removed broad session-change cache invalidation while promising that “retained owners still expose currentness/release.” The retained-owner check includes registry runs, but its release promise covers only session admissions. Real command cleanup releases admission before awaited cleanup and final run-context removal, so recovery can retain a run without a subsequent wake.
The coordinator now observes only runtime/run-registry changes for retained owners and wakes when that ownership ends. Deferred retry deadlines remain intact. Reset removes the observer, and the existing test now also covers admission releasing before run-context cleanup. The operations documentation describes this distinction.
Evidence
d5c7055a7006: the original retained-run case fails; 76 other cases pass. The two original ownership cases pass onc7242cb54d7c, parent of refactor(agents): simplify completed-run bookkeeping #174838. Relevant source is unchanged between that PR's landed commit and the reproduced main.--maxWorkers=1.No timeout, assertion, retry budget, or authority check was weakened. PR CI supplies broad proof; no workflow was dispatched or rerun.