Repository navigation
fix(subagents): failed requester wake no longer strands an expired completion for 7 days - #176145
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 changesRecords failed delivery when an expired subagent completion’s final requester wake finishes undelivered. Example: A child finishes successfully, delivery expires, and its requester wake ends with “requester turn failed.”
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current completion-settlement bug through the existing owner; no actionable P0–P2 defects were found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe completion kernel consumes requester-wake outcomes and commits native subagent delivery state and deduplicated notification intents together in SQLite. flowchart TD
A[Completed child] --> B[Expired delivery]
B --> C[Requester wake]
C --> D[Completion mutation owner]
D --> E[SQLite delivery state]
D --> F[Deduplicated blocked notice]
Technical reviewBest possible solution: Settle both successful and failed expiry-wake outcomes atomically through the existing completion owner while preserving results and notice identity. Do we have a high-confidence way to reproduce the issue? Current main exposes the unsuccessful-settlement path, and the existing SQLite fixture directly exercises it; no target code was executed during this read-only review. Is this the best way to solve the issue? This is the smallest complete fix: extend the existing expiry exception to failure outcomes, retaining the transaction, ownership checks, permanent-suspension exclusion, and bounded retry policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 919888778d13. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -2, Tests +33, Docs +5. Total +36 across 3 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 HistoryReviewed October 18, 2026, 4:45 PM ET / 20:45 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Cover private-parent recovery, retained completion payloads and notice identity, and rollback after a failed settlement write. Keep the existing kernel as the single failure owner. Original fix by Sukhdeep Johar in openclaw#176145; additional regression coverage adapted from openclaw#176146. Co-authored-by: Sukhdeep Johar <[email protected]> Co-authored-by: xyi74976-del <[email protected]>
|
@clawsweeper re-review Maintainer cleanup folds the private-parent, retained payload/notice identity, and failed-write rollback coverage from #176146 into this PR, with contributor credit. The body records the final scope and ownership checks. Per maintainer proof policy, exact-head PR CI is the execution proof. Live Gateway, lease, local typecheck/test, and production-revert proof requests are intentionally skipped; please review P0–P2 code findings against the current head. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…mpletion for 7 days (openclaw#176145) * fix(subagents): settle expired completions when their requester wake fails * docs(subagents): note failed settlement of expired completions * fix(subagents): preserve failed expiry settlement contracts Cover private-parent recovery, retained completion payloads and notice identity, and rollback after a failed settlement write. Keep the existing kernel as the single failure owner. Original fix by Sukhdeep Johar in openclaw#176145; additional regression coverage adapted from openclaw#176146. Co-authored-by: Sukhdeep Johar <[email protected]> Co-authored-by: xyi74976-del <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: xyi74976-del <[email protected]>
Fixes #176117
What Problem This Solves
A finished child's result stays suspended with no retry owner when direct delivery expires and the final requester recovery wake fails. The row then waits for the seven-day discard instead of recording the failure.
User Impact
Exhausted recovery now records failed delivery immediately, keeps the child's result and payload, and preserves the existing blocked-delivery notice without duplicating it. This covers ordinary and private-parent completions. It does not restart exhausted retries or repair rows whose wakes were cleared before the fix; existing cleanup and retention still apply.
Why This Change Was Made
Expiry transfers settlement to the requester wake, but the completion kernel previously admitted an expiry-suspended row only for a successful outcome before clearing that wake unconditionally. Both outcomes now use the existing worker-owned transaction for delivery settlement, notice deduplication, and wake removal. Permanent suspensions remain excluded. No schema, persisted fields, configuration, or retry policy changes.
Original fix by @sukhdeepjohar; maintainer cleanup incorporates @xyi74976-del's private-parent, payload/notice retention, and failed-write rollback coverage from #176146, with coauthor credit. #176146's implementation and regression scope are covered here; its announcement documentation is represented by the operations documentation in this PR.
Deferred facts: the existing settlement path reselects canonical run/execution/delivery and requester-cohort identities under registry FIFO, checks the current Gateway lifetime, cancellation/commit episode and rearm generation, and revalidates writer admission at transaction and commit. The existing state-worker context binds the original database path/lifetime; captured outcome/error is the completed attempt's historical fact. This patch adds no new deferred work, captured config, limits, leases, or destinations.
Evidence
110914e51c486fbfd885284b7b5e31c7d373f125: success-only expiry settlement followed by unconditional wake removal; the sweeper only age-discards the resulting unowned suspension. The earlier positive-receipt contract stays intact.f40411ccd5cf899cbd6b646c708da2a0025299c1after merging current main: 38 successful jobs, including planned tests, production/test typechecks, lint, docs, and UI checks. The PR rollup has 58 passing checks and no failures or pending checks. No retries or inherited-failure exceptions were needed.fails the expired delivery when its requester wake ends undelivered (target=%s)covers ordinary and private-parent results after SQLite reopen, retained result/payload, cleared wake, suppression, and unchanged notice identity.preserves the suspended delivery and wake when failed settlement write rejects the receiptextends the existing rollback table. Permanent-suspension and successful-receipt coverage remains.git diff --checkpassed.ca6a7854d570; they were not rerun or claimed as exact-head proof.