Repository navigation
fix(test): synchronize subagent recovery validation - #157242
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. Reviewed September 25, 2026, 10:21 PM ET / September 26, 2026, 02:21 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch makes subagent recovery tests observe agent RPC entry and settle owned work, checks replacement task identity, and updates the built-Gateway timeout fixture for current tool and compaction behavior. Merge readiness✅ Ready for maintainer review Keep open. Merged work covers related fixtures, but current main retains the timing-based wait addressed here. The verified test merge preserves this PR’s distinct repair, and review found no blocking patch defect. Priority: P2 Review scores
Verification
How this fits togetherThe subagent registry records child completion before announcing results to a requester. These tests check that asynchronous work and a Gateway timeout recovery path produce one durable completion. flowchart LR
A[Child lifecycle event] --> B[Registry and worker reads]
B --> C[Agent RPC entry]
C --> D[Fixture wait]
D --> E[Delivery assertions]
F[Gateway recovery turn] --> G[Scripted provider]
G --> E
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +69. Total +69 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep recovery assertions tied to observed RPC entry and settled owner work, while retaining the built-Gateway check for current timeout and compaction behavior. Do we have a high-confidence way to reproduce the issue? Yes for the fixture timing defect: current main advances fake time while waiting for worker-backed RPC entry, and the PR reports a controlled before-and-after check. This review did not run the test, and the historical intermittent failure was not naturally reproduced. Is this the best way to solve the issue? Yes. Observing RPC entry and joining its producer is narrower than increasing retry time; the Gateway fixture tests the current direct-tool and summary contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a410b4d0fb53. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Preserve current main lifecycle owners and accepted task-write drains. Observe RPC entry without advancing fake retry time, join retained producers and restore fixtures on failure, assert the replacement task identity, and align the scripted timeout fixture with current tool and summary contracts. No production behavior or test deadlines change. Co-authored-by: steipete <[email protected]>
35ef957 to
7857e7e
Compare
|
Merged via squash.
|
Preserve current main lifecycle owners and accepted task-write drains. Observe RPC entry without advancing fake retry time, join retained producers and restore fixtures on failure, assert the replacement task identity, and align the scripted timeout fixture with current tool and summary contracts. No production behavior or test deadlines change. Co-authored-by: steipete <[email protected]>
What Problem This Solves
Fixes subagent recovery fixtures spending fake retry time while native worker reads have not reached the agent RPC, and using an outdated scripted timeout-summary contract.
User Impact
No production behavior changes. Recovery validation observes actual work entry, preserves meaningful failure outcomes, and cleans up owned work even when settlement rejects. The built-Gateway timeout scenario again exercises the current tool and compaction contracts.
Why This Change Was Made
Most of the original proposal now has a landed replacement. This candidate keeps main’s registered async task owner, requester and sentinel joins, awaited registration, transcript matching and accepted task-write drain. It does not restore the old async-export spy or archive helper.
Only the remaining fixture changes are retained: observe RPC entry while racing the existing lifecycle producer, retain serial joins and unconditional cleanup, assert the replacement finalizer’s task identity, and give the scripted timeout provider direct tools plus distinct turn-prefix/history summaries. Deadlines, delivery assertions and authority policy are unchanged.
Requested by Peter Steinberger during release-verification repair.
Worked on by
Work sessions
Evidence
Merged:
22e8095bdec1db6c13126674d5cc161390af186cat 2026-09-26 02:32:48 UTC through native completed-evidence admission. Exact attempted head, current-main containment, human co-author credit, native completion receipt/comment and native worktree/branch cleanup were verified. No admin bypass or altered drift policy was used.Merged source 7857e7e, verified tree df3ae4226ca92a5db7bec0945b0181cb663ab991, starts from main 9665d17 and changes four test/helper files, +103 / −34. Current main’s replacements in #158020, #157150 and #157634 are retained rather than duplicated.
Readiness and cleanup
The current-main baseline passed 14/14 standalone and 58/58 grouped; the historical intermittent failure was not naturally reproduced. Controlled checks established the narrower synchronization defect: the original loop consumed 800 ms of fake retry time before observing the first RPC, versus 0 ms with explicit entry observation through the same sibling-race entrypoint. Injected producer rejection and normalized retryable-before-first-RPC each still failed the intended case, with 13 other tests passing. Temporary controls were removed.
Final lifecycle source passed 485 test executions: retry-grace 20 × 14, the three-file lifecycle group 3 × 58, archive 26, and the shared-helper announce-loop consumer 5. Standalone retry runs took 21.74–39.49 s wall (546.35 s total); group runs 71.02 / 57.18 / 67.51 s; archive 24.49 s; announce-loop 27.50 s. Native sequencing covered both retry→requester→archive and requester→retry→archive, not a fabricated original full-shard replay.
These fixture-owned source tests use actual worker-backed state and mocked Gateway dispatch through the supported process-local E2E build-skip contract. They are not built-Gateway or packaged-runtime proof. The existing accepted-write drain remains enabled. Exact-source changed checks and independent P0–P2 review passed for this lifecycle patch; the complete four-file composition then passed canonical changed-scope checks, including core/package/root-test types, all three dead-export scans, lint, formatting and ratchets. Fresh repository autoreview of that full composition was scoped-clean through P2. Commit hooks preserved the exact reviewed tree. Completed hosted CI/review evidence is recorded below.
The retry file was at its 1,000 counted-line cap. Only its scoped readiness contract was extracted into the existing support file; no new helper file, production seam, baseline change, timer increase or weakened assertion was introduced. The historical early-retryable sibling outcome remains unexplained and is not claimed fixed by passing runs.
Built timeout recovery
The timeout file is byte-identical to separately qualified commit 49f91db. Configured Blacksmith Testbox, Node24.19.0 / pnpm12.4.2 / 4 CPUs, ran a normal private-QA build (556.15 s, exit0) and both complete timeout/steering files (8/8, 131.84 s wall). The timeout case itself passed in 43.274 s, preserving one completed child, durable delivery, exactly one outbound completion and completion within the compaction window.
That proof’s exact content tree was d7cf6f6b52c4e89756d83499b5ec417dd4024283, with all 49,946 source entries verified before/after. It also contained a separate steering fixture not included in this PR. The timeout file and Gateway implementation inputs are unchanged here; this is scoped reuse, not a claim that the complete four-file candidate was rebuilt on that lease. The lease is stopped/completed and raw captures remain private. No live-provider, Codex, Windows/macOS or full-release success is claimed.
Completed hosted proof
CI36211046795 / attempt1 completed successfully: 34 successful jobs, 21 skips, zero failures. Both required CI-gate contexts and dependency/security statuses passed. The fresh exact-head ClawSweeper review found no actionable findings or before-merge items.
Preflight and executing-job checkout logs, corroborated by the commit API, bind execution to merge 08025540a73b7c0b63cc239ef9e7731eefbe0bf3, parents main7f5db650… + this PR head, tree d8508e2ea8de135014f087e2437ccc28360e441c. The changed-test job ran pnpm build qaRuntime successfully in47.4s, then passed archive26, retry/grace14 and the built-Gateway timeout case1 (55.763s assertion /68.67s Vitest).
This supplies new integrated-tree runtime evidence beyond the earlier separately qualified timeout run. It is not a full default production build, platform matrix or natural reproduction of the historical intermittent failure.
Superseded scope and remaining limits
The former six-file proposal and its historical stress results are not relabeled as current proof. The previously proposed repeated 66/67-file Gateway matrix was never run and is not counted here. After consuming the owning mainline replacements, this PR qualifies only its remaining fixture contracts through the focused source tests, independent built timeout case and normal exact-head CI/review gates. The broader frozen release diagnostic is not claimed green.
View the OpenClaw team session