Repository navigation
fix(agents): align requester wake tests with yielded batch scope - #159352
Conversation
Follow the frozen cohort contract documented in #158642. Assert independent yielded delivery and live Gateway ownership, then release completed bindings. Keep stale settlement budget assertions on an owned descendant.
|
🦞👀 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 26, 2026, 11:10 PM ET / September 27, 2026, 03:10 UTC (Revision 2). ClawSweeper reviewWhat this changesUpdates subagent requester-wake integration tests to check independent yielded-batch delivery, Gateway binding cleanup, and stale settlement within the batch’s descendant tree. Merge readiness✅ Ready for maintainer review Current main still has the outdated requester-wide test expectations, while its production wake logic uses frozen batch scope. The proposed correction matches that contract, and this review found no introduced defect. Priority: P2 Review scores
Verification
How this fits togetherWhen a requester yields, the subagent registry records the children in that batch and waits for their descendants to settle. The wake owner then sends the batch result through the owning Gateway; these tests exercise that lifecycle. flowchart LR
A[Requester yields] --> B[Frozen child batch]
B --> C[Registry checks descendants]
C --> D{Batch settled?}
D -->|No| E[Wake remains pending]
D -->|Yes| F[Owning Gateway sends wake]
F --> G[Requester receives result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +13. Total +13 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep owner-boundary coverage for a completed yielded batch waking once while unrelated work remains active, and for a descendant within that batch delaying settlement. Do we have a high-confidence way to reproduce the issue? Yes. The PR reports two failures from the focused file on a main ancestor, and current main retains the same relevant test and wake-owner code; this review did not execute the test. Is this the best way to solve the issue? Yes. The assertions now check the documented frozen-batch boundary and retain coverage for pending sibling work, binding lifetime, and stale descendant settlement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ad149a907b6a. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…nclaw#159352) Follow the frozen cohort contract documented in openclaw#158642. Assert independent yielded delivery and live Gateway ownership, then release completed bindings. Keep stale settlement budget assertions on an owned descendant.
Related: #158642
What Problem This Solves
Fixes two requester-wake E2E failures caused by tests retaining the old requester-wide settlement contract after yielded batches became independent.
User Impact
No runtime behavior changes. The tests now protect independent yielded-batch delivery, live Gateway ownership, and bounded stale settlement within the batch's own descendant tree. No configuration or migration is required.
Why This Change Was Made
Remote adjacent-commit bisection identified
d919bfbb4d892ca2ec7ec9fe59f34a172ef91295. Its PR explicitly states that a frozen batch waits only for its own children and descendants;docs/tools/subagents/announce.mddocuments the same contract. The wake owner passes frozenrootRunIdsinto settlement and active-work queries (subagent-announce.requester-settle-wake.ts:245). These are stale tests, not a production regression.The overlapping-turn case now requires alpha's yielded batch to deliver alpha-only findings while beta remains running with delivery pending, then verifies there is still only one wake after beta completes. Exact captured Gateway resolver checks remain while rows own work. After alpha's settlement, the test requires its binding to be released, matching the existing documented lifecycle from #126062; beta's live binding must remain unchanged through reactivation.
The stale-cap fixture formerly put its blocker outside the frozen batch. It now places that blocker beneath the batch child. Every existing deferral-count, deadline, exhaustion-error, non-delivery, and foreign-active-work assertion remains.
The introducing PR did not change this E2E file. The changed-test planner intentionally omits related E2E targets unless the E2E file itself changes (
scripts/lib/ci-changed-node-test-plan.mts:1207), explaining the coverage gap. This PR directly changes the file.Evidence
All test execution used Linux Blacksmith Testboxes through
node scripts/crabbox-wrapper.mjs, withpnpm install --frozen-lockfilebefore testing. No local tests were run.74469f58f38c15d14ee4cddf24a498c6c21821ad: complete requester-wake file 16 passed / 2 failed, reproducing both exact reported assertions.37469917520b379b8cf231cc2f99424242489151: 9/9 selected cases passed (both failures plus overlapping-turn controls).d919bfbb4d892ca2ec7ec9fe59f34a172ef91295: 7 passed / 2 failed, with the same two assertions.git bisect start --first-parent <introducing> <parent> -- src/agents/subagentsidentifies this first bad commit. Both adjacent revisions used independent frozen installs and identical dependency manifests.pnpm test src/agents/subagents/registry/subagent-registry.requester-wake.e2e.test.ts --maxWorkers=1: 18/18 passed three consecutive times. Command wall: 486.87s including the fresh runtime build, then 33.39s / 33.88s using that build; Vitest wall 42.99s / 31.73s / 32.21s.src/agents/subagents/**/*.test.tsfiles intonode scripts/run-vitest.mjs: 2,756 passed, one existing opt-in entry-reload benchmark skipped; 353.06s across six native shards. Includes all five E2E files (151/151). The four credential-dependent live-provider files were not run.node scripts/check-changed.mjs --base 74469f58f38c15d14ee4cddf24a498c6c21821adcompleted in 1,586.80s, failing only broad core lint on unchangedsrc/gateway/session-row-projection.tsandsrc/state/openclaw-state-worker-runtime.ts(701 counted lines / 700 limit). Both files and lint configs were verified byte-identical to the base, and the exact failures reproduced in a focused remote lint invocation. Open fix(ci): keep untouched line-limit drift from blocking changed checks #158995 owns untouched-file enforcement; no suppression or policy change is included. All preceding guards, typechecks and three Knip scans passed. The post-test working tree also contained unrelated Workboard manifest drift, which expanded that default selection.node scripts/check-changed.mjs --base origin/main -- src/agents/subagents/registry/subagent-registry.requester-wake.e2e.test.ts src/agents/subagents/registry/subagent-registry.requester-wake-settlement.test-support.ts, through the wrapper's frozen base overlay. Wrapper command phase: 275.65s. It selected onlycoreTests, passed theagents-othertype graph, all guards/ratchets, all three Knip scans, formatting, and scoped lint with zero warnings/errors.git diff --checkpassed.Attribution/reproduction lease:
tbx_01m3g1jstfrkjyfhzaf8ktwx4w(run). Its provider shut it down during an earlier changed-check attempt; that incomplete gate is not counted. Final proof lease:tbx_01m3g7eqk6m07m39max5nqsbvq(run). Wrapper source verification binds proof to the candidate tree, independently of the hydration workflow's SHA.A wider bisect probe initially crossed a dependency bump without reinstalling and stopped at a declaration-build error; it was not classified as a bad revision. The fresh adjacent-commit comparison above supplies attribution. No retries, test skips, assertion weakening, or timeout changes were added.
Exact-head CI run 36290149086 is attached and queued; hosted test seconds are pending. Security Review and PR context/evidence checks have passed. Auto-merge is disabled and no merge is requested. Both task leases are completed/stopped. Duplicate-fix searches were refreshed immediately before publication against main
23ad3a56a0b7d732513d49ea62e53a8e90b84337; only existing failure reports matched, and no intervening commit changed the two tests or wake owner.Published head:
f75f2d0197c32b3fa11fc3d2c60d7e317d45be03; tree2c55e4357656a380b02dfa175305234b6605c64cexactly matches the final verified Testbox source and reviewed patch.