Repository navigation
fix(agents): reconcile late requester recovery receipts - #155357
Conversation
|
Codex review: needs changes before merge. Reviewed September 22, 2026, 8:42 AM ET / 12:42 UTC (Revision 7). ClawSweeper reviewWhat this changesRechecks recovery receipts before reporting an unsettled requester handoff, reuses the existing response classification, and adds late-completion and cancellation regressions. Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: current main still lacks this bounded recovery repair, and the reviewed patch has no actionable correctness findings. The broader requester-starvation report remains unresolved. Priority: P1 Review scores
Verification
How this fits togetherSubagent completion delivery wakes the requesting agent after its children finish. This change reconciles the handoff result with an existing recovery receipt before returning delivery status to the completion owner. flowchart TD
A[Completed subagent batch] --> B[Requester handoff]
B --> C{Outcome needs reconciliation?}
C -->|No| F[Existing delivery result]
C -->|Yes| D[Read exact recovery receipt]
D --> E{Owner and session still current?}
E -->|Yes| G[Classify recovered outcome]
E -->|No| F
G --> H[Completion owner settles batch]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +176, Tests +366. Total +542 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep receipt reconciliation within the existing delivery owner, preserving once-only execution, cancellation and exact session identity. Do we have a high-confidence way to reproduce the issue? Yes, from source for the narrow race: create an exact recovery receipt while the original handoff awaits, then return a pending, empty or restart-interrupted response. Current main does not reread that receipt; this review executed no runtime tests. Is this the best way to solve the issue? Yes. Reusing the existing worker reader and receipt classifier addresses the observation gap without adding another recovery owner or replaying the input. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d2b9c87ac5ad. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
caf30eb to
34d9cf7
Compare
34d9cf7 to
7961833
Compare
7961833 to
c6caf0f
Compare
Reconcile late exact requester receipts through the existing short-lived worker reader without replaying a settled handoff. Preserve original outcomes and keep the change limited to the three reviewed files. Correct the Vitest callback/cleanup contract and brace the test conditions; retain all 23 intended cases and once-only assertions. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: jalehman <[email protected]>
c6caf0f to
9950e10
Compare
|
@clawsweeper re-review The sole remaining proof item for exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* commit '739e2410702e0b1ad1d17a6dac07ddc0ab6dbebb': (140 commits) fix(ui): pause passive polling in hidden tabs (#155617) improve(android): keep chat photos outside text bubbles (#155338) fix(ui): preserve saved project after discovery failure (#155619) feat: compare Kitchen Sink Gateway resource costs (#155734) test(gateway): arm clock-jump claim after readiness (#155748) chore(ui): refresh control ui locales (#155700) fix(ci): join archive placement fixtures before teardown (#155751) fix(matrix): keep bot discovery off the Gateway thread (#152122) fix(agents): reconcile late requester recovery receipts (#155357) test(gateway): guard embeddings HTTP fixture lifetimes fix: isolate triage fixture acquisition and cleanup (#155736) refactor(sessions): hydrate saved transcripts off thread (#153325) fix: Claude MCP turns abort before tool timeout (#155663) fix(goals): pause terminal failures and clarify goal states (#155694) fix(test): preserve watcher errors when diagnostic capture fails (#155383) ci: move native runtime proofs to release validation (#155606) fix(auth): decouple compaction from profile rotation (#155204) fix(agents): admit compaction outside retired plugin generations (#151232) perf(ui): reduce automatic session list refetches (#155705) test: avoid unused source repos in release input fixtures (#155733) ...
) Observe exact late requester recovery receipts before returning an eligible retryable handoff outcome. Reuse the existing short-lived worker reader and response classifier without dispatching the input again. Preserve ownership/cancellation boundaries, committed and ambiguous results, explicit stops, permanent outcomes, and private/incognito exclusions. Keep the repair scoped to the three reviewed announce files. No registry, transaction, schema, dependency or worker-framework changes. Validation: exact-head CI 35726842329 passed both required gates and all 23 authored regressions. Current-context native run 35729961457 passed the existing final-response/same-session-follow-up case on the explicitly bound production-plus-fixture composite, with fulfilled cleanup and verified native/host closure. Other E2E branches retain their historical proof; no authenticated external-provider or release acceptance is claimed. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: jalehman <[email protected]>
Related: #143334
Merged companion fixture correction: #155621.
Current qualification boundary
Current head
9950e106f44f6db979a413158c96f4cf09cf48e8retains the identical reviewed three-file patch and postimages on frozen existing-fix base95221a8922d27d4b69d186cfde5065c0bba962b6. Normal hooks and all four human credit trailers are preserved. The separate fixture correction is already merged as43834997528540d0fd2c5b792eb18c0dbdbb47e1.Fresh exact-head CI passed: run 35726842329/1, 120 successful jobs, 17 skipped, zero failed, both required
openclaw/ci-gateentries SUCCESS. All 23 authored regressions and relevant delivery/requester/reader siblings passed. The previously timed-out persisted-worker case passed in 2.931s on the existing fixture-isolation repair; channel contracts and their cleanup also passed. These outcomes do not explain or erase the older failures.The requested current-context final-response/same-session-follow-up witness is complete. Native run 35729961457 tested source
9950e106plus the identical already-landed fixture, verified compositea06e5f313dff1f589d1b8b5dca876baba2a37bcd. Exactly one final/follow-up case passed; the other three were intentionally unselected/skipped, retaining their prior branch proof rather than being claimed as fresh passes. All 60 named input postimages and all 48,347 source-manifest entries were verified. Original assertions include the initial request surviving the announcement budget, running-to-done state, one visible final, ordinary same-session follow-up, retained result and cleared wake.Sanitized native result excerpt:
The case took 20.848s; file time was 20.856s. E2E command wall 524.91s already includes 476.4s of private-QA preparation required by the native freshness owner. These are nested envelopes, not additive costs. No whole four-case, 31-stage, separate normal-build or manual 23+12 replay was added.
Wrapper/native exit was 0 at 13:04:53 UTC on September 22, 2026. Gateway and model cleanup fulfilled; the native lease stopped, owned staging/wrapper are absent, and the source overlay was restored clean after retaining all 60 postimages. The backing delegated workflow reached completed/cancelled at 13:09:47 UTC after native successful one-shot stop; that is lifecycle closure, not a failed or cancelled test. Raw native log SHA-256:
98e6d5f1ff0fe545a44c4ab73e2c7422d53e8946b0379a57b6e7788006830c3f.This supplies the single proof item requested by the exact-head ClawSweeper review. It is real built-Gateway/worker/SQLite integration with a held loopback provider, not authenticated external-provider proof, a forced live trace of every late-read race, or final release qualification. Prior failed attempts and broader issue limitations remain preserved below. Normal native landing remains pending; no production merge or release pass is claimed.
What Problem This Solves
A requester recovery can finish the exact input while the original completion handoff is still awaiting its result. The original response can then look pending, empty, or interrupted even though recovery has already settled it.
User Impact
Eligible requester-settle handoffs recheck the exact recovery receipt before returning a retryable outcome. They do not dispatch or send the input again. Successful, ambiguous, intentional, permanent-failure, and explicit-stop outcomes keep their existing policy.
Why This Change Was Made
This is a targeted three-file replacement for the earlier broad proposal. It reuses the existing short-lived worker reader, binds the late observation to the captured requester/session/lifecycle/idempotency identity, and rechecks cancellation and caller ownership around the awaited read. An extracted helper preserves existing response classification rather than adding delivery policy.
There are no registry, transaction, schema, dependency, or worker-framework changes. Private/incognito paths and ordinary announcements do not acquire this extra recovery read. Failure to observe a receipt does not authorize a fresh requester turn.
Evidence
On corrected source
79618339483fe7224e03829f8d3788d2dcc1bb2c:8ec9547f692e57393bd6e18eca0bd757562d8289stamps canonical identities, verifies their persisted round trip, and captures bounded redacted Gateway diagnostics and cleanup outcomes. On unchanged companion production source, native run 35707654516 verified composite tree6e83cab45c872811c4df35b5edc252f4d016ae95and all four E2E cases passed: final response, normal runtime timeout, explicit stop and bounded restored concurrency. All four Gateway/model-server cleanup records fulfilled, and the native Testbox reported stopped/completed. Cases took 61.159 seconds; command wall 623.82 seconds includes freshness-required private-QA preparation on a new host. Previous 31 checks/build/23+12 cases were not replayed.The E2E uses a held loopback model server, not an authenticated external provider. Controlled unit/harness checks and real built-runtime composition are distinct evidence; not every forced late-read interleaving is claimed as an independently traced live event.
Still open: normal native landing. Fresh exact-head CI and the single current-context witness passed as recorded above; older proof retains its original input boundaries. Auto-merge remains off. Full release-candidate qualification stays with the release workflow. No assertion, deadline, safety guard or required gate has been relaxed; no merge or release pass is claimed.