Repository navigation
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. What this changesAllow an interrupted subagent completion to settle after cleanup retires its transient recovery marker. Example: Gateway recovery interrupts generation 1, then generation 2 continues in the same child session before the original completion settles.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current settlement defect with a narrow change that preserves the surrounding ownership checks; no actionable code findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe completion admission store checks retained run snapshots against current registry ownership before committing delivery and requester-wake bookkeeping through the existing SQLite worker. flowchart TD
A[Interrupted child run] --> B[Cleanup controller]
B --> C[Registry published row]
D[Retained completion snapshot] --> E[Completion admission store]
C --> E
E --> F[SQLite mutation worker]
F --> G[Settled delivery and cleared wake]
Technical reviewBest possible solution: Recognize completed cleanup as preserving the same interrupted result’s settlement custody within the existing admission owner. Do we have a high-confidence way to reproduce the issue? Current source exposes the conflicting cleanup and settlement predicates, and published baseline output fails at the intended owner check; this read-only review executed no target code. Is this the best way to solve the issue? The patch is the smallest complete repair: refine the existing comparison for the verified one-way cleanup transition while preserving runtime, generation, lifecycle, requester, kill, terminal-time, and outcome checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 05bc4bf5c9fc. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +29, Tests +119. Total +148 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 23, 2026, 9:50 PM ET / October 24, 2026, 01:50 UTC (Revision 2). |
|
@clawsweeper re-review The PR body now includes inspectable archived Gateway/driver log excerpts and exact read-only SQLite audit output for the source-only failure and combined |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Closes #182062. Related: #142224, #182046, and #181184.
What Problem This Solves
Fixes a completed requester turn leaving its interrupted child's durable wake dispatching after legitimate cleanup retires the child's transient recovery marker.
User Impact
The same interrupted task can finish completion bookkeeping after cleanup, including when a follow-up already owns the child session. Changed runtime, task, requester, child incarnation, kill state, or terminal result still refuses settlement.
Why This Change Was Made
src/agents/subagents/completion/subagent-completion-admission.store.ts:280on the inspected main rejected anyterminalOwnerchange.src/agents/subagents/registry/subagent-registry-lifecycle-bookkeeping.ts:166legitimately clearsinterrupted-recoveryafter recording cleanup and the sticky session-effects fence. A retained requester completion therefore lost settlement solely because cleanup succeeded.The existing admission owner now recognizes that one-way transition only with the cleanup receipt, sticky fence, and identical interrupted terminal timing/outcome. It retains the surrounding owner and requester checks, then commits through the existing registry/SQLite path. Late provider and yield results remain fenced.
Team relevance is bounded: the sanitized journal correlation in merged #181184 records a recovered parent/requester-settle session
fa35e3ac, a later yield-cleanup timeout at boot-log line 3744, stale reports at 4113/4265, and six queued-without-run reports at 4542/4635/4928/5435/6569/8395. Those logs establish a related cleanup wedge, but do not identify its retained barrier or prove this exact marker mismatch. This PR fixes the independently reproduced settlement defect; it does not claim to repair every Team cleanup timeout.Evidence
Maintainer validation uses main
7b71c23797646bed71dc869b83a1c51764c267a6merged into the original contributor commit, without rebasing or changing the two-file patch.currentCompletionOwnerwithSubagent completion owner changed before mutation; all 13 changed-state controls pass. The real cleanup controller creates the cleanup state, and the test reopens SQLite to verify durable settlement or unchanged rejected rows. Baseline: 1 failed / 13 passed, 167.82 seconds wall time (158.46 seconds reported by Vitest, dominated by compilation).426650184280128f24b5ae72558cc137804c85cc: all 67 completion/storage cases passed (51 requester-wake, 16 storage/admission), followed by all 3 late-provider/yield controls. The two-file run took 362.21 seconds including cold worker compilation; the changed file reported 59.09 seconds, of which 57% was test execution. The three filtered lifecycle controls took 97.61 seconds including cache validation; skipped cases are not claimed as executed.agents-sessions, 6.9 seconds). Focused typed lint, formatting, andgit diff --checkpassed.scoped-clean, no actionable P0–P2 findings on the committed branch. The review covers the patch; executed behavior is established separately above.426650184280128f24b5ae72558cc137804c85cc, run 40053463881. Ten superseded same-lane checks are excluded by the native policy. No rerun or inherited-failure exception was needed.Production delta: +31/-2 lines (net +29). Tests: +119/-0. The added code is the narrow predicate needed to distinguish legitimate marker retirement from a different terminal winner; no new owner, retry loop, schema, config, or authority is introduced. Thanks @ericcaiwx-star; the contributor's commit and patch are preserved.
Accepted limits: this is completion bookkeeping, not requester-source admission (#182046) or pending-parent continuation source recovery (#182043). No live Team/Gateway or real channel was touched. The contributor reported separate combined-patch synthetic Gateway proof, but maintainer acceptance here rests on the executed owner/SQLite regression and final-head CI; it makes no standalone live-provider or business-side-effect claim.
Focused validation commands
Node 26.12.1; repository-selected Bun test runtime. The baseline uses the first test file with
-t 'settles a cleaned interrupted winner'against the unmodified main owner. Skipped cases from filtered runs are not counted as executed.