Repository navigation
fix: report subagent requester waiting and consumption truthfully - #199695
Conversation
Record mailbox waiting and transcript consumption through the existing registry writer. Join consumption receipts before cancellation settlement, preserve private requester delivery through restart, and keep yielded visible-final obligations separate. No SQLite schema, delivery execution, retention, or configuration changes. Integrate repaired main for the pre-existing filesystem and cron export-check failures. Focused lifecycle/wake tests pass; delayed receipt regression fails before the ordering repair. Codex autoreview reports no actionable P0-P2 findings.
|
🦞👀 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 changesThis PR records requester waiting and consumption separately and preserves consumed private results through cancellation. Example: Requester run requester-continuation consumes a private child result before Gateway restart.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a concrete delivery-state defect, and the latest head resolves the prior bookkeeping-failure finding without introducing another actionable defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSubagent completion delivery connects child results to requester session inputs; transcript persistence records consumption, and the registry supplies delivery facts to settlement, recovery, and diagnostic readers. flowchart TD
A[Child completion] --> B[Requester mailbox]
B --> C[Requester transcript owner]
C --> D[Registry consumption write]
D --> E[Completion settlement]
E --> F[Recovery and diagnostic readers]
C --> G[Separate visible reply obligation]
Technical reviewBest possible solution: Keep consumption recording at the existing transcript and registry owners while preserving transport outcomes and separate visible-final obligations. Do we have a high-confidence way to reproduce the issue? The base handoff reports intentional non-delivery while pending, and cancellation lacks a stored consumption fact; supplied regressions and Gateway restart results exercise both paths, without running target code during this review. Is this the best way to solve the issue? The direct recording approach uses existing persistence and source-custody owners, removes the competing receipt projection, and implements the maintainer's accepted write-cost tradeoff. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dd2d58be4b4a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +200, Tests +336, Docs +11, Other +240. Total +787 across 39 files. Added test files: 2. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
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 (6 earlier review cycles)
Reviewed November 15, 2026, 6:40 PM ET / 23:40 UTC (Revision 7). |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper review Please review final head |
|
🦞👀 Re-review progress:
|
All three runs retained their execution, captured result, delivery values, and task text. Agent name/workspace and Gateway settings survived. New waiting/consumed writes succeeded on those old rows, survived database reopen, and appeared in the compact session-list reader. The already-delivered row stayed delivered. Relevant code: the fact is optional in subagent-registry-read.types.ts:49; the existing payload decoder accepts old rows in subagent-registry.store.codec.ts:43; optional compact fields are selected at subagent-registry.store.sqlite.ts:171. Synthetic compatibility output: {"baseline":"[email protected]","schemaBefore":22,"schemaAfter":40,"retainedRuns":3,"oldPayloadsLoaded":true,"resultTextExecutionAndDeliveryPreserved":true,"settingsPreserved":true,"newWaitingAndConsumedWrites":true,"compactProjectionAndReopen":true,"integrity":"ok"}The real Gateway private-continuation restart case also passed on the final source: consumption recorded before shutdown and retained after it; delivered after recovery; exactly one captured result input and one final reply across two restarts. The assertions are at gateway-subagent-completion-restart.e2e.test.ts:353, 385, 409, and 428. Its model endpoint is synthetic HTTP; the Gateway, agent, persistence, cancellation, and restart paths are real. The 538 focused passing tests separately retain the yielded visible-final requirement. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Coordinating the restart result-loss follow-up (lane 2519) with this PR. I have read fb2fe55 and will reuse its directly recorded requester-consumption fact once it lands. Current investigation is at restart requester discovery, completion-input replay identity, and registry removal/retention; I am not replacing the consumption recorder. I am extending the existing real Gateway restart fixture for a busy non-yielded requester and adding a regression for a retryable failed row reaching the five-minute sweeper. Any overlap in the restart test will be reconciled against this final head before publication. |
|
2519 update: the real Gateway restart harness now reproduces both accepted-completion and pending-input idempotency conflicts. Accepted text/provenance and requesterOrigin/operatorProfileId are unchanged, but restored synthetic admission drops senderId/senderName. One input was consumed; its sibling was still queued. I am fixing attribution replay in the existing |
|
Merged via squash.
|
…enclaw#199695) * fix: carry committed requester delivery facts into dispatch * fix: retire requester input when waiting receipt fails Keep waiting receipt persistence inside existing dispatch cleanup so concurrent Stop cannot leak an unadopted mailbox input. Join source settlement in the Gateway stop proof and remove the obsolete same-process watcher fixture assertion; database-owner retirement coverage remains. * fix(subagents): derive delivery state from committed requester receipts * test(subagents): consolidate requester receipt regression coverage * fix(subagents): record requester consumption directly after transcript commit * fix(subagents): preserve delivery outcome after bookkeeping failure
Main's openclaw#199695 reworked requester settlement: the requester batch now marks delivery through markDelivered, and a blocked completion whose input the requester already consumed is also marked delivered. Conflicts: - subagent-completion-mutation.kernel.ts: main's version, with recordPrivateConsumption after both markDelivered calls. The requester batch passes the outcome's requesterVisibleFinalDelivered as before. The blocked completion passes false: its outcome did not deliver, so no visible final reached the user. - subagent-registry-lifecycle-delivery.ts: both imports. - subagents-tool.ts: deliveryStatus keeps resolveSubagentDeliveryStatus, next to main's new requesterDelivery field. - subagent-completion-admission.requester-wake.test.ts: both new cases. subagent-requester-delivery.test.ts (main's cancelled-continuation case) now also checks the reported status: consumed_privately without a visible final, failed with one, for both the requester batch and the blocked path. The test-lines allocation is 58 to match.
* fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching #199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]>
* fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching #199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 8f0d03f)
* fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching #199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 8f0d03f)
* fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching openclaw#199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]>
* improve(ci): avoid duplicate release source guard scans * fix(ci): classify recovery browser test server ownership (#200402) (cherry picked from commit a62e4e1) * fix(ci): restore package harness startup Copy the runtime process dependency manifest into the dependency-free packaging fixture so the CLI reaches argument validation. The existing startup assertion continues to reject missing modules. (cherry picked from commit 84262af) * test(facetime): preserve child process exports in audio fixture (#200419) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 36549cb) * test(browser): align fixtures with navigation and CLI contracts (#200428) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit d0daf88) * fix: restore Codex qualification fixture contracts (#200450) * fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching #199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 8f0d03f) * fix(crabbox): join heartbeat command cleanup before retirement (#200466) (cherry picked from commit 6247dc4) * fix(agents): retain ambiguous completed-answer receipts * fix(qa): ignore workspace context when detecting continuation --------- Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
) * improve(ci): avoid duplicate release source guard scans * fix(ci): classify recovery browser test server ownership (openclaw#200402) (cherry picked from commit 4a2270d) * fix(ci): restore package harness startup Copy the runtime process dependency manifest into the dependency-free packaging fixture so the CLI reaches argument validation. The existing startup assertion continues to reject missing modules. (cherry picked from commit 7dfdaec) * test(facetime): preserve child process exports in audio fixture (openclaw#200419) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit b12070e) * test(browser): align fixtures with navigation and CLI contracts (openclaw#200428) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit d623a9b) * fix: restore Codex qualification fixture contracts (openclaw#200450) * fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching openclaw#199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit d0d35ab) * fix(crabbox): join heartbeat command cleanup before retirement (openclaw#200466) (cherry picked from commit a823861) * fix(agents): retain ambiguous completed-answer receipts * fix(qa): ignore workspace context when detecting continuation --------- Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
* improve(ci): avoid duplicate release source guard scans * fix(ci): classify recovery browser test server ownership (#200402) (cherry picked from commit a62e4e1) * fix(ci): restore package harness startup Copy the runtime process dependency manifest into the dependency-free packaging fixture so the CLI reaches argument validation. The existing startup assertion continues to reject missing modules. (cherry picked from commit 84262af) * test(facetime): preserve child process exports in audio fixture (#200419) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 36549cb) * test(browser): align fixtures with navigation and CLI contracts (#200428) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit d0daf88) * fix: restore Codex qualification fixture contracts (#200450) * fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching #199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 8f0d03f) * fix(crabbox): join heartbeat command cleanup before retirement (#200466) (cherry picked from commit 6247dc4) * fix(agents): retain ambiguous completed-answer receipts * fix(qa): ignore workspace context when detecting continuation --------- Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 60e0e21) Release adaptation: Preserve baseline authored-request continuation classifier and extractToolOutput import; newer #201244 behavior already exists. Apply runtime-context split and regression without downgrading it.: Backport review: #201130 selected by sibling; #201331 and #198760 are independent package script changes. #201244 classifier already present-equivalent on baseline.: (cherry picked from commit ad2ae0e0e2bf242ab0df9f9ca29f4f848caf478c)
) * improve(ci): avoid duplicate release source guard scans * fix(ci): classify recovery browser test server ownership (openclaw#200402) (cherry picked from commit a62e4e1) * fix(ci): restore package harness startup Copy the runtime process dependency manifest into the dependency-free packaging fixture so the CLI reaches argument validation. The existing startup assertion continues to reject missing modules. (cherry picked from commit 84262af) * test(facetime): preserve child process exports in audio fixture (openclaw#200419) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 36549cb) * test(browser): align fixtures with navigation and CLI contracts (openclaw#200428) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit d0daf88) * fix: restore Codex qualification fixture contracts (openclaw#200450) * fix: restore Codex run-attempt qualification coverage Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching openclaw#199695. No production behavior or timeout changes. Co-authored-by: RomneyDa <[email protected]> * test: align Codex refresh callback fixtures Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 8f0d03f) * fix(crabbox): join heartbeat command cleanup before retirement (openclaw#200466) (cherry picked from commit 6247dc4) * fix(agents): retain ambiguous completed-answer receipts * fix(qa): ignore workspace context when detecting continuation --------- Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 60e0e21) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 90fc6d5fa4c9d0f348e83ae63fd63c3072e03433)
What Problem This Solves
Fixes misleading subagent delivery records while results wait behind a requester, and false failures when a private continuation consumes results before restart cancels it.
User Impact
The stored registry row distinguishes waiting from consumption and names the requester run. Restart cancellation preserves consumed private results. A separate visible-final obligation remains required. Exactly-once delivery, restart custody, retention, configuration, and SQLite schema are unchanged.
Why This Change Was Made
Pending handoff used a terminal non-delivery disposition, and cancellation classified the continuation outcome without retaining its already-completed consumption. Waiting now joins the existing dispatch write. After the requester commits its result-bearing transcript input, its existing source owner immediately starts and joins one registry consumption write before settlement. Readers use that stored fact directly; the receipt-backed projection, cold receipt reads, and their tests are removed.
Read-only aggregate Team evidence supplied by the reliability peer, November 15: r335/292a4253 run4924541e ended at15:44:05Z; direct announce failed at15:44:12Z; its pending row looked intentionally undelivered while waiting behind requester settlement created at15:45:11Z, then delivered once at15:49:17Z. On r334/b09f4a04, a50bec84/e11342db remained pending for over20minutes although the continuation started at11:40:31Z had consumed both; shutdown recorded failed while restart-resume retained the results. No Team mutation or data copy was used.
The maintainer chose direct recording and accepted up to four registry commits per batch in exchange for removing the projection machinery. This implementation uses three registry commits per two-result batch, versus two on the exact main parent, plus the same one existing transcript commit in both arms. Final production delta is +200 lines; tests are +336 lines, with no test-budget exception. The benchmark adds240 lines and documentation11 lines, counted separately. This removes163 net production lines from the rejected projection version and28 from the earlier direct version. Remaining growth records facts at the transcript/registry owners and distinguishes consumption from a separately owed final; it adds no cache or scan.
Evidence
Baseline:
89ee0bd382d16ec16183a10e81a8930a92ed1909. Candidate:fb2fe55a2d61ac1be0edb468b17613f3f14dec56.pnpm check:changedfound two fixture type errors and an async-finally lint error. All identified failed type/lint gates pass separately after repair. Every other full-run gate passed. The aggregate command retains its original failure status; no aggregate-green claim is made. The subsequentpnpm check:changed --base HEADrepair run passes in full. Final Codex autoreview is scoped-clean at P0–P2, including an independent review of the bookkeeping-failure repair.Production-shaped synthetic fixture: 39.9GiB agent DB, 10,800 sessions, 4,300 retained runs, and62,000 workspace files/1.116GB. Five interleaved A/B pairs and five A/A pairs for timing and sampled allocation,30 two-result batches/process:40 processes,1,200 batches,2,400 results. Every batch asserts the expected commit count and terminal result. The first measured batch is reported separately; no filesystem cache flush was performed. Local APFS does not reproduce Team's btrfs commit waits.
Warm median cost: +0.418ms wall, +0.460ms CPU, and about106KB sampled allocation per batch. A/A paired median differences: wall+0.77% (range−25.05..+104.53%), CPU+0.36% (−8.34..+49.19%), allocation+0.0003% (−1.00..+0.22%). Host one-minute load ranged19.91–52.79; concurrent checks make timing tails noisy. Allocation includes first-call work. These measurements quantify the accepted extra write; no speedup is claimed. CPU profiles are retained for both arms.
Command:
node --expose-gc --import ./scripts/tsx.mjs scripts/perf/subagent-requester-delivery-measure.mts <fixture> <output> <baseline|candidate> <exact-parent-overlay|-> <time|allocation>. Fixture background verification previously could not stage its snapshot due to disk/temp-root limits; no integrity or permission bypass was used. The offline owner benchmark uses normal admission outside measured batches.The preceding direct head passed CI run 43772398866 without a rerun. Final-head CI run 43775439266, attempt 2 passed on
fb2fe55a2d61ac1be0edb468b17613f3f14dec56. Attempt 1 repeated the known hosted restartSessionStoreUnavailableError; the single authorized plain--failedrerun passed, without debug flags or source changes. This is not an inherited-failure exception or a claim that replay repaired the intermittent. Final-head ClawSweeper has zero open items and no findings; the repaired Codex thread is resolved. Earlier projection-head CI exposed a scheduled-command reset test/contract regression reproduced on the exact main parent and attributed by owner history to3bbf67501123a640c4634f782ba56aac6050dd3c; that regression is recorded for the lead, not dismissed as noise.