Repository navigation
fix(agents): retain collector rollback through retirement publication - #157940
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 27, 2026, 1:45 AM ET / 05:45 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch delays failed collector rollback until cancellation publication finishes, preserves the accepted run during restored-launch retries, and extends agent and Gateway regression coverage. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this PR open. Current main still performs accepted-run rollback before cancellation publication, while this branch addresses that ordering gap. The related merged PRs repair separate validation issues, and no actionable defect was established in the introduced patch. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's Swarm scheduler admits collector subagents through a FIFO lane, while the subagent registry tracks their launch and retirement. On launch failure, Gateway abort and session cleanup must settle before that lane admits the next collector. flowchart LR
A[Collector request] --> B[Swarm FIFO lane]
B --> C[Gateway accepts child run]
C --> D{Registry transition succeeds?}
D -->|yes| E[Running child]
D -->|no| F[Cancellation publication]
F --> G[Abort or guarded delete]
G --> H[Release FIFO slot]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +34, Tests +265. Total +299 across 7 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep retirement publication with the registry owner, and retain the accepted run and FIFO reservation until guarded rollback and failure settlement finish. Do we have a high-confidence way to reproduce the issue? Yes, as a source-level ordering case: current main can enter accepted-run cleanup before retirement publication, and the added Gateway test supplies a focused Stop overlap. This read-only review did not run that case. Is this the best way to solve the issue? Yes. The branch uses the registry's existing publication barrier and cleanup path while retaining the exact accepted run for retry, which is narrower than adding another scheduler hold. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against efd55b746d8e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…openclaw#157940) * fix(subagents): retain pending collector cleanup until Stop publishes * fix(agents): settle accepted collector rollback after publication * test(agents): keep collector fixtures within line caps * fix(test): avoid unhandled catalog startup rejection (openclaw#158440)
What Problem This Solves
A failed collector launch can reach destructive cleanup while cancellation still owns retirement publication. A temporary cleanup refusal can also be mistaken for confirmed termination, releasing FIFO capacity before the accepted run is settled.
User Impact
Failed collector work retains its FIFO ownership until publication and termination settle. Restored cleanup retries settle the original accepted attempt without dispatching another agent. No configuration or migration is required.
Why This Change Was Made
Use the existing retirement-publication owner for fresh and restored collectors. Failed registry transitions retain their accepted run ID; termination runs after publication. The existing abort-to-delete fallback and session identity guards remain intact.
The integration preserves main's async requester capture, earlier FIFO reservation, restart/forced-yield coverage and intentional fixture pruning. The stronger restored rollback regression uses main's typed restore factory; extracted preference/permission tables retain only main's surviving cases. The restored-deadline tests retain their cleanup joins. The rollback test asserts publication overlap, deletion retry, dispatch order and single abort; it does not assert a whole-test root-work join.
Candidate
3130f149097150b0d6a47bad7d4ac1ae8447eb5fintegrates main706ffe7a79c087b17add0f08b31c8ca3487052f0. The seven-file residual is 733 changed lines: production 51 additions / 17 deletions (net +34), tests 465 additions / 200 deletions. Production growth retains rollback lifetime and exact retry identity at the existing owner. Both production files and the queued-admission regression are unchanged from the previously reviewed collector repair. The catalog fix already landed through #158440 has no residual contribution.Evidence
Landed through the native guarded squash route as
d00524c29577. All seven contributed file blobs match the reviewed head.Current exact-head hosted CI passed. Run 36297827109 completed on
3130f149097150b0d6a47bad7d4ac1ae8447eb5f: 119 successful jobs and 21 skipped jobs. All 43 compact changed Node jobs passed, alongside production types, five core test-type shards, aggregate test-types, core lint and guards. The required CI gate is green. Historical failures below retain their original scope..claude/settings.json, and the full-source guard refused the snapshot. The native command exited 1, its exact worker stopped, and the original owner joined. No suite, lint or type lane ran; integrated focused-test cost remains unmeasured. Full-sync omission remains an unresolved proof-transport follow-up, without changing the source guard or inventing a passing run.