Repository navigation
refactor(subagents): simplify queued registration recovery - #207016
Merged
Merged
Conversation
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. |
vincentkoc
marked this pull request as ready for review
November 27, 2026 23:50
vincentkoc
deleted the
refactor/subagent-recircuit-r4-queued-recovery
branch
November 28, 2026 00:19
Member
Author
|
Merged via squash.
|
This was referenced Nov 28, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 28, 2026
…207016) * refactor(subagents): share queued registration recovery decisions * fix(subagents): avoid shadowing queued registration state
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.
Related: #206472
What Problem This Solves
Queued subagent registration repeats recovery and row-eligibility decisions across launch, cancellation, and failure settlement. Maintaining those copies makes this already complex circuit harder to change safely.
User Impact
No intended behavior change. Queued launches still wait for kill claims, preserve the first failure for retry, and refuse cleanup or replay when a write outcome is uncertain. Existing tests are unchanged.
Why This Change Was Made
The registration owner now uses one recovery classifier, one queued-row selector, and one shared acceptance predicate. The redundant persistence uncertainty flag and three single-use admission wrappers are removed.
Circuit map
Local state writers are also contained in this owner: the registration loop acknowledges registration; waitForClaim records restore failures; failIncompleteRegistration retains the first error and manages pending/retry state; prepareCancelled and settleCancelled own cancellation settlement; canContinueSettlement and settleFailedLaunch retire stale settlement; and publish records its own terminal execution after publication.
The retained inputs are the acknowledged row, database context, lifecycle generation, Gateway resolver, manager row/config reads, activation callback, and caller assertion. Effects remain claim waiting, collector preparation, serialized mutation, published-output cleanup, and observer activation. No durable shape changes.
Deletions and remaining decisions
Complexity boundary
registerRequiredQueuedSubagent decreases from CC 128 to 107, and SLOC 328 to 303. This does not meet the numeric half-baseline target. The retained branches distinguish documented, tested outcomes: claim release/reacquisition, committed cancellation versus ordinary launch failure, refused versus unknown writes, registry/Gateway retirement, accepted-address rekeying, and newer sibling session ownership. They remain separate because they trigger different persistence, retry, or cleanup effects. No helper was extracted solely to move complexity out of the metric.
Evidence