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: blocked before merge. What this changesThis PR atomically settles rejected requester wakes, matching completion deliveries, and physical queue entries. Example: On the historical branch, run-gateway-restored-settle-pending receives NO_REPLY during restored requester delivery.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open as a maintainer-engaged draft: current main removed the task-ledger failure paths, while its remaining recovery scope awaits an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherSubagent completion connects finished child runs to requester continuations; registry wakes, SQLite delivery state, and the session queue govern retries and restart recovery. flowchart TD
A[Terminal child run] --> B[Requester wake lifecycle]
B --> C[Completion settlement owner]
C --> D[SQLite transaction]
D --> E[Delivery queue state]
D --> F[Durable wake state]
F --> B
Technical reviewBest possible solution: Use the existing native completion owner for any demonstrated remaining defect, preserving captured-outcome requirements unless an owner explicitly approves historical recovery. Do we have a high-confidence way to reproduce the issue? No current-main failing reproduction is established; historical task-owner failures were removed, and current source explicitly rejects missing-outcome settlement. Is this the best way to solve the issue? Atomic, generation-fenced settlement is appropriate, but any remaining repair must extend the native owner and establish a defect beyond its intentional evidence requirements. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dfd4904312e8. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +349, Tests +721. Total +1070 across 7 files. Added test files: 1. 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: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 (6 earlier review cycles)
Reviewed October 31, 2026, 8:40 AM ET / 12:40 UTC (Revision 7). |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Related fix: #150065 does not implement durable rejected-wake reconciliation, exact cohort/generation fencing, physical queue terminalization, or restart replay suppression. Its cancellation classification is a different boundary. This PR's requester-settle convergence work for #137332 is not superseded; retain the documented missing-task-owner limitation. |
|
Related to #151949, but not superseded. That merged change handles a successful same-owner receipt after expiry suspension. This PR has broader rejected/mixed-batch, historical-owner, physical-queue terminalization, and restart-convergence scope. Keeping this PR open; retain its distinct ownership, queue, and rollback coverage. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Acknowledging the October 8 recovery-policy review. I moved this to draft and updated the description: #137332 is closed after #159179, and the earlier comparisons with #150065/#151949 do not settle the missing-native-outcome policy. My proposed remaining scope is only a demonstrated post-retirement queue/wake convergence defect for native owners with captured outcomes; absent-outcome rows would stay unresolved, with no inferred verdict from retired task projections. Does the completion owner want that narrowed follow-up, and is there a current persisted-state reproduction for it? I will not restore the retired task ledger or claim the historical Gateway proof qualifies current main. No new tests or re-review are claimed/requested. |
Related: #137332
Current Status - October 31
Draft; recovery policy and native-owner integration are unresolved. Issue #137332 is closed after Tasks/TaskFlow retirement in #159179. The earlier comments distinguishing this PR from #150065 and #151949 do not establish acceptance of using legacy task evidence in the replacement native owner.
The October 8 review identifies the remaining decision: whether legacy exact-owner task evidence may substitute for a missing captured native execution outcome when permanently stopping delivery. That interpretation has not been accepted. This branch must not restore the retired task ledger or silently weaken native outcome checks.
Proposed scope for owner confirmation: integrate only a demonstrated remaining queue/wake convergence defect for native owners with captured execution outcomes; leave missing-outcome records unresolved unless a separate historical-recovery policy is explicitly approved. A current post-retirement reproduction is needed to justify the remaining production change. Existing branch proof below does not establish that current-main defect or qualify an integration with the new owner.
Before ready: confirm the remaining scope, resolve conflicts in the native settlement owner, and requalify rollback, cohort/generation checks, persisted-state recovery, and restart suppression. No source changes or fresh test runs are claimed on October 31. Head remains
444d33e3124d577571dd40279db4f1eb88d5f891.What Problem This Solves
On its pre-retirement base, this branch targets an issue where terminal subagent completions could retain a durable requester-settle wake after the final handoff was rejected, causing the same failed reconciliation to run repeatedly across Gateway restarts. This includes non-success child outcomes, already-delivered task projections, historical rows without a captured outcome, and legacy partial settlements whose physical delivery queue entry remained replayable.
Why This Change Was Made
Rejected requester-settle batches now validate their exact wake, frozen cohort, task/run owner, and delivery generation before settling all affected state in one SQLite transaction. Retired or already-cleared frozen members may disappear without trapping the surviving owner, including legacy wakes without a rearm generation, while an omitted member that still holds the same wake generation in SQLite rejects the whole transaction. The transaction terminalizes any matching replayable session-queue owner, preserves task delivery already observed by the requester, and clears or retires the durable wake atomically; legacy rows that already lost their logical queue ID are reconciled by the full physical owner tuple.
This is an incremental repair on top of #137344. It intentionally does not clear rows whose task owner is entirely absent, because that state still needs an explicit owner-safe reconciliation policy.
User Impact
On the tested historical branch, operators no longer see represented terminal subagent completions retry the same rejected requester wake indefinitely after restart, and stale physical queue work cannot replay after the wake is closed. Existing successful or already-delivered task outcomes remain intact.
Evidence
node scripts/run-vitest.mjs src/agents/subagents/completion/subagent-completion-requester-settle.store.test.ts src/agents/subagents/registry/subagent-registry-lifecycle.test.ts src/agents/subagents/registry/subagent-registry.test.ts: 365 passed.NO_REPLY: 1 passed; task, logical delivery, queue, and wake reached their durable terminal projections, and a second Gateway start made no additional model request.pnpm tsgo:core, changed-file Oxlint, and changed-file Oxfmt checks passed.