Repository navigation
fix(subagents): wake a yielded requester for each ready child result - #203176
Conversation
A requester that yielded after spawning several completion children was woken only when every member of the frozen batch was ready, so a sibling that kept running or exec-yielded hid finished results for hours. Deliver the ready members as a partition; members still working keep their wake and generation and wake the requester again. Followup callers and Goal returns continue on the partition that leaves nothing pending. Co-authored-by: obviyus <[email protected]>
|
🦞👀 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 changes before merge. What this changesThis PR delivers ready child results to a yielded requester while unfinished siblings retain their later completion wakes. Example: A parent yields after spawning alpha and beta; alpha finishes while beta runs a background sleep.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this PR addresses a demonstrated requester stall, but an existing Gateway consumer test still asserts the replaced batching behavior and fails on the reviewed head. Priority: P1 Before merge
Findings
Agent review detailsHow this fits togetherThe subagent registry retains child completion obligations, and the settlement owner converts eligible results into requester mailbox inputs while coordinating follow-up replies and Goal continuation. flowchart TD
A[Child execution results] --> B[Registry completion obligations]
B --> C[Ready partition selection]
C --> D[Requester mailbox]
D --> E[Requester continuation]
C --> F[Unfinished sibling wakes]
E --> G[Followup and Goal settlement]
Technical reviewBest possible solution: Keep the existing owners and partition implementation, and update the Gateway consumer regression to verify separate, nonduplicated deliveries across child resumption. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the blocking gate, and the PR supplies matching base/head Gateway observations plus two reported red-on-base, green-on-head registry regressions; no target code was executed during this review. Is this the best way to solve the issue? Partitioning at the existing settlement owner addresses the blocking cause, and the follow-up, Goal, lifecycle-failure, and pre-yield changes serve that same invariant without introducing another manager or storage format. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c7be87560920. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +22, Tests +221, Docs +7. Total +250 across 16 files. Added test files: 1. 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. 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 Reviewed November 21, 2026, 11:42 AM ET / 16:42 UTC. |
…ss result partitions Co-authored-by: obviyus <[email protected]>
|
…n its request needs them Co-authored-by: obviyus <[email protected]>
…al wakes Co-authored-by: obviyus <[email protected]>
Co-authored-by: obviyus <[email protected]>
|
Landed in 09d956b.
|
…penclaw#203176) ## Problem A requester that calls `sessions_yield` after spawning several completion-mode subagents was woken only when every member of the frozen yield batch was ready. A sibling that keeps running, or that pauses on its own `sessions_yield` while a background command runs, held every finished result back. Production incident (2026-11-21): a dashboard parent spawned 3 children and yielded at 16:20 IST. Two children finished at 16:26:58 and 16:29:41 with reports that needed a decision. The third kept cycling through exec-yield and resume. The Gateway log has no `announce:requester-settle:…` run for that parent. The parent ran again only at 18:32, when the user typed into the chat. A copy of the state database shows why: both finished rows were `terminal`/`ok` with `delivery.status: pending` and a pending `requesterSettleWake` (`batchRunIds` = all 3, `rearmGeneration: 1`). The third row was still `running`. The gate in `subagent-announce.requester-settle-wake.ts` returned `false` unless every frozen member passed `isRequesterSettleMemberReady`. openclaw#200967 had already made an exception for siblings that wait for a message. An exec-yielded or running sibling is the same bug class. ## Change Rule: every ready result wakes the yielded parent. Siblings that are still working keep their wake, with the same `rearmGeneration`, and wake the parent again when they finish. Each result is delivered once. - **Settle wake:** removed the all-or-nothing gate and the message-wait exception (`isEndedSubagentMessageWait` is deleted). The wake delivers the ready members of the frozen batch as one partition, and lists the members that are still working. A member whose partition has already started dispatch records its own batch, so a later partition never offers it again. When a partition holds only results that were already delivered and siblings are still pending, it settles without a redundant wake. - **Wake message:** a partition that leaves members pending no longer says "every subagent has settled… do not call sessions_yield again". It names the siblings that are still working (label, task name or run ID, at most 5, each truncated) and tells the parent: if the request needs those results, call `sessions_yield` to wait; otherwise act on the ready results without reporting the batch as finished. - **Lifecycle failure path:** `offeredBatch` now offers only ready members, so failure settlement can never consume the wake of a sibling that is still running or exec-yielded. - **Yield transfer:** when a child ended before the yield and a sibling is still running, `afterRelease` now schedules the settle for the finished child. Before, nothing woke the parent until the sibling ended. - **Followup owners** (`sessions_send` wait-for-reply, `agent-step`, nested `agent-run-subagent`): the caller is waiting for a single reply. Only the partition that leaves no member pending continues the followup. Earlier partitions wake the session as ordinary settle turns. `successor()` accepts that last partition as a subset of its cohort, so it no longer throws and records the result as a permanent failure. - **Automation authority:** a yield that carried cron-management authority keeps it for the partition that leaves no member pending. Earlier partitions run without borrowing it, and settling them shrinks the retained cohort instead of discarding the authority. - **Silent waits:** while siblings are still working, the parent may stay silent (`NO_REPLY`) and wait. Such a turn is not treated as a missing visible reply, so it is not retried. - **Goal return:** an earlier partition leaves the Goal cohort when it settles. The partition that settles the cohort last resumes the Goal once. - `isRequesterSettleMemberReady` moved to `subagent-run-liveness.ts`, its only owner, and replaces the deleted message-wait predicate. - Docs: `tools/subagents/announce.md` and `concepts/subagent-yield-handoff.md`. Product decisions, under the rules "no stranded user" and "no false done": - A stopped child is a settled outcome, so its report now wakes the parent right away instead of waiting for its siblings. - A followup caller gets one reply, after all results are in. The session itself is still woken for each result. ## Evidence **Regression test** (`subagent-registry.requester-wake.e2e.test.ts`, real registry, lifecycle, yield tool and wake entry point): spawn 2 children, yield, finish one, keep the other exec-yielded. The parent is woken with the finished result, and the wake names the working sibling. The sibling's continuation then wakes the parent again with only its own result. A sweep adds no third wake. A second case covers a child that ended before the yield, while the requester's turn held it. - Base `60d77af57e31`: both cases red (`expected [] to have a length of 1`: no wake). - Head: both cases green. **Owner tests:** cron authority (`requester-cron-authority.test.ts`: the early partition neither borrows nor consumes the authority, and the last partition is admitted with it), followup partition (`subagent-announce.requester-settle-followup.test.ts`: early partition runs with no followup successor, last partition carries it). Goal partition (`goal-continuation.test.ts`: early partition does not resume the Goal, last partition resumes it once). **Updated tests that asserted the all-at-once rule:** `requester-settle-cross-turn` (paused member), `subagent-control.worker` progress card (one wake per result; the card retires once), `requester-wake-settlement` (stopped child). **Real-Gateway E2E**, incident shape. Scratch `ocx src` Gateway under `env -i`, OpenAI `gpt-5.5` on the OpenClaw runtime. Parent spawns `alpha` (replies at once) and `beta` (`exec` with `background: true` running `sleep 90`, then `sessions_yield`), then yields. | | alpha ended | first parent wake | beta yielded | beta ended | second parent wake | |---|---|---|---|---|---| | base | 19:47:10 | **19:48:53** (one combined run, after beta) | 19:47:13 | 19:48:50 | none | | head | 19:40:08 | **19:40:11** (`announce:requester-settle:…:<alpha>:yield-1`) | 19:40:12 | 19:41:55 | 19:41:59 (`…:<beta>:yield-1`) | The parent's replies on head were `alpha: ALPHA-RESULT-7`, then `alpha: ALPHA-RESULT-7 / beta: BETA-RESULT-9`. The live Peanutto launchd pid and `openclaw.json` hash did not change. **Live sibling suites** (`subagent-yield-pause`, `subagent-followup-yield`, `subagent-yield-resume`, real OpenAI `gpt-5.5`): the same tests fail on base `60d77af57e31` and on this branch, with the same assertions (missing `completion.resultText` after a resumed or paused child completes, a Gateway shutdown timeout, an interim reply in the follow-up watch case; follow-up-yield failed 2 of 2 on base). One run of this branch showed a parent that wrote its final report as soon as the first result arrived; the wake message now says to keep waiting when the request needs the remaining results, and that failure no longer appears. The real-Gateway restart e2e files (`test/gateway-*-restart*.e2e.test.ts`) fail locally on base too (11 of 26 on base, 9 of 26 here, same assertions). **Gates:** `pnpm tsgo:core`, `pnpm check:test-types`, oxlint and oxfmt on the changed files. Every test file in `src/agents/subagents` and `goal-continuation.test.ts` was run across the unit-fast, infra, agents-support, spawn-boundary, core-isolated and e2e projects. Two infra tests failed once under host load and passed when run alone, on head and on base. ## Size Production code is +96 / −56. The gate, the message-wait exception and its predicate are deleted. The added lines are the partition support the old gate did not need: pending members in the message, the followup last-partition rule, Goal cohort shrink, and pre-yield scheduling, and cron-authority cohort shrink. A census of `batchRunIds`, `requesterYieldBatch`, the frozen branch and `selectConnectedSettledSubagentWave` found every remaining reader still in use. v8 coverage could not attribute lines under the compiled-worker test runner (0 files collected in two attempts), so the census was done by reading the code. ## Accepted edge cases - If a Goal cohort's last partition is rejected for an unrelated reason (for example, a rearm-generation mismatch), the Goal return stays retained until Stop or a lifecycle rotation. That is the same outcome as a failed final delivery today. - A nested requester whose early partition answers without yielding reports that answer to its parent. The later result wakes it again as a separate completion. ## Merge danger - **Two-way door.** No schema, stored-row or config change: the wake rows keep their existing fields and generation. A revert restores the all-at-once wake for every cohort, including rows written while this change ran. - **Blast radius:** requesters that yield on two or more completion children (dashboard, chat and nested subagent requesters). A defect here would show as an extra or a missing wake for the parent, not as a lost child result: every result stays saved in its child session. Co-authored-by: Ayaan Zaidi <[email protected]>
…203102) (cherry picked from commit 2e1d67c) Release adaptation: Stable merged read owner retained; terminal-delivery filtering moved to its query; main-only benchmark and helper omitted. Companion audit: #203176 and #203222 selected in lane; #204260, #204178 and #203839 not selected (not a prerequisite). Co-authored-by: RomneyDa <[email protected]>
…203176) ## Problem A requester that calls `sessions_yield` after spawning several completion-mode subagents was woken only when every member of the frozen yield batch was ready. A sibling that keeps running, or that pauses on its own `sessions_yield` while a background command runs, held every finished result back. Production incident (2026-11-21): a dashboard parent spawned 3 children and yielded at 16:20 IST. Two children finished at 16:26:58 and 16:29:41 with reports that needed a decision. The third kept cycling through exec-yield and resume. The Gateway log has no `announce:requester-settle:…` run for that parent. The parent ran again only at 18:32, when the user typed into the chat. A copy of the state database shows why: both finished rows were `terminal`/`ok` with `delivery.status: pending` and a pending `requesterSettleWake` (`batchRunIds` = all 3, `rearmGeneration: 1`). The third row was still `running`. The gate in `subagent-announce.requester-settle-wake.ts` returned `false` unless every frozen member passed `isRequesterSettleMemberReady`. #200967 had already made an exception for siblings that wait for a message. An exec-yielded or running sibling is the same bug class. ## Change Rule: every ready result wakes the yielded parent. Siblings that are still working keep their wake, with the same `rearmGeneration`, and wake the parent again when they finish. Each result is delivered once. - **Settle wake:** removed the all-or-nothing gate and the message-wait exception (`isEndedSubagentMessageWait` is deleted). The wake delivers the ready members of the frozen batch as one partition, and lists the members that are still working. A member whose partition has already started dispatch records its own batch, so a later partition never offers it again. When a partition holds only results that were already delivered and siblings are still pending, it settles without a redundant wake. - **Wake message:** a partition that leaves members pending no longer says "every subagent has settled… do not call sessions_yield again". It names the siblings that are still working (label, task name or run ID, at most 5, each truncated) and tells the parent: if the request needs those results, call `sessions_yield` to wait; otherwise act on the ready results without reporting the batch as finished. - **Lifecycle failure path:** `offeredBatch` now offers only ready members, so failure settlement can never consume the wake of a sibling that is still running or exec-yielded. - **Yield transfer:** when a child ended before the yield and a sibling is still running, `afterRelease` now schedules the settle for the finished child. Before, nothing woke the parent until the sibling ended. - **Followup owners** (`sessions_send` wait-for-reply, `agent-step`, nested `agent-run-subagent`): the caller is waiting for a single reply. Only the partition that leaves no member pending continues the followup. Earlier partitions wake the session as ordinary settle turns. `successor()` accepts that last partition as a subset of its cohort, so it no longer throws and records the result as a permanent failure. - **Automation authority:** a yield that carried cron-management authority keeps it for the partition that leaves no member pending. Earlier partitions run without borrowing it, and settling them shrinks the retained cohort instead of discarding the authority. - **Silent waits:** while siblings are still working, the parent may stay silent (`NO_REPLY`) and wait. Such a turn is not treated as a missing visible reply, so it is not retried. - **Goal return:** an earlier partition leaves the Goal cohort when it settles. The partition that settles the cohort last resumes the Goal once. - `isRequesterSettleMemberReady` moved to `subagent-run-liveness.ts`, its only owner, and replaces the deleted message-wait predicate. - Docs: `tools/subagents/announce.md` and `concepts/subagent-yield-handoff.md`. Product decisions, under the rules "no stranded user" and "no false done": - A stopped child is a settled outcome, so its report now wakes the parent right away instead of waiting for its siblings. - A followup caller gets one reply, after all results are in. The session itself is still woken for each result. ## Evidence **Regression test** (`subagent-registry.requester-wake.e2e.test.ts`, real registry, lifecycle, yield tool and wake entry point): spawn 2 children, yield, finish one, keep the other exec-yielded. The parent is woken with the finished result, and the wake names the working sibling. The sibling's continuation then wakes the parent again with only its own result. A sweep adds no third wake. A second case covers a child that ended before the yield, while the requester's turn held it. - Base `eb7ca3d33375`: both cases red (`expected [] to have a length of 1`: no wake). - Head: both cases green. **Owner tests:** cron authority (`requester-cron-authority.test.ts`: the early partition neither borrows nor consumes the authority, and the last partition is admitted with it), followup partition (`subagent-announce.requester-settle-followup.test.ts`: early partition runs with no followup successor, last partition carries it). Goal partition (`goal-continuation.test.ts`: early partition does not resume the Goal, last partition resumes it once). **Updated tests that asserted the all-at-once rule:** `requester-settle-cross-turn` (paused member), `subagent-control.worker` progress card (one wake per result; the card retires once), `requester-wake-settlement` (stopped child). **Real-Gateway E2E**, incident shape. Scratch `ocx src` Gateway under `env -i`, OpenAI `gpt-5.5` on the OpenClaw runtime. Parent spawns `alpha` (replies at once) and `beta` (`exec` with `background: true` running `sleep 90`, then `sessions_yield`), then yields. | | alpha ended | first parent wake | beta yielded | beta ended | second parent wake | |---|---|---|---|---|---| | base | 19:47:10 | **19:48:53** (one combined run, after beta) | 19:47:13 | 19:48:50 | none | | head | 19:40:08 | **19:40:11** (`announce:requester-settle:…:<alpha>:yield-1`) | 19:40:12 | 19:41:55 | 19:41:59 (`…:<beta>:yield-1`) | The parent's replies on head were `alpha: ALPHA-RESULT-7`, then `alpha: ALPHA-RESULT-7 / beta: BETA-RESULT-9`. The live Peanutto launchd pid and `openclaw.json` hash did not change. **Live sibling suites** (`subagent-yield-pause`, `subagent-followup-yield`, `subagent-yield-resume`, real OpenAI `gpt-5.5`): the same tests fail on base `eb7ca3d33375` and on this branch, with the same assertions (missing `completion.resultText` after a resumed or paused child completes, a Gateway shutdown timeout, an interim reply in the follow-up watch case; follow-up-yield failed 2 of 2 on base). One run of this branch showed a parent that wrote its final report as soon as the first result arrived; the wake message now says to keep waiting when the request needs the remaining results, and that failure no longer appears. The real-Gateway restart e2e files (`test/gateway-*-restart*.e2e.test.ts`) fail locally on base too (11 of 26 on base, 9 of 26 here, same assertions). **Gates:** `pnpm tsgo:core`, `pnpm check:test-types`, oxlint and oxfmt on the changed files. Every test file in `src/agents/subagents` and `goal-continuation.test.ts` was run across the unit-fast, infra, agents-support, spawn-boundary, core-isolated and e2e projects. Two infra tests failed once under host load and passed when run alone, on head and on base. ## Size Production code is +96 / −56. The gate, the message-wait exception and its predicate are deleted. The added lines are the partition support the old gate did not need: pending members in the message, the followup last-partition rule, Goal cohort shrink, and pre-yield scheduling, and cron-authority cohort shrink. A census of `batchRunIds`, `requesterYieldBatch`, the frozen branch and `selectConnectedSettledSubagentWave` found every remaining reader still in use. v8 coverage could not attribute lines under the compiled-worker test runner (0 files collected in two attempts), so the census was done by reading the code. ## Accepted edge cases - If a Goal cohort's last partition is rejected for an unrelated reason (for example, a rearm-generation mismatch), the Goal return stays retained until Stop or a lifecycle rotation. That is the same outcome as a failed final delivery today. - A nested requester whose early partition answers without yielding reports that answer to its parent. The later result wakes it again as a separate completion. ## Merge danger - **Two-way door.** No schema, stored-row or config change: the wake rows keep their existing fields and generation. A revert restores the all-at-once wake for every cohort, including rows written while this change ran. - **Blast radius:** requesters that yield on two or more completion children (dashboard, chat and nested subagent requesters). A defect here would show as an extra or a missing wake for the parent, not as a lost child result: every result stays saved in its child session. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 09d956b) Release adaptation: Kept stable QA Gateway fixture lifecycle; filtered intentionally silent partial-result wakes. Companion audit: #203222 selected. #204249, #204069, #204048, #203892, #202513, #198960 not applicable (refactors/test cleanup); #204260, #204178, #204098, #204089, #203839, #203271 missing in lane and not prerequisites. Co-authored-by: RomneyDa <[email protected]>
…203176) Baseline adaptation: Implement stable requester/cron partition custody, exact retry and settlement in existing payload; delegated Goal-return prerequisite is absent and excluded. (cherry picked from commit 09d956b) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit b3f8e0a7abcb4d09eca90dd4c21bc1b1ac2892bb) (cherry picked from commit f66d0cc36e8169d78d45e376404b8059736b1e32)
Preserve the existing requester restart reason in announce classification so unconsumed completed results remain pending for startup custody. Existing consumption receipts prevent replay; permanent refusals, explicit cancellation, and ambiguous sends retain their policies. (cherry picked from commit b8b06c4) Follow-ups: fca5133 fix: preserve child completion inputs across Gateway restarts (#208367) [not selected for this narrow backport]; b7967b2 fix: deliver a saved child answer after a Gateway crash (#207706) [not selected for this narrow backport]; 17e2ec9 fix: tell the user when a finished subagent's report can't start in their chat (#207194) [not selected for this narrow backport]; 811f999 refactor(subagents): centralize completion delivery decisions (#206383) [not selected for this narrow backport]; 50a6774 fix: retain channel requester when child completion resumes parent [separately ordered lane row]; d2699a8 chore: carry and enforce participant limits on admitted runs (#204847) [not selected for this narrow backport]; 57dd84b fix(agents): settle every undelivered child completion into history; drop delivery dispositions (#204260) [separately ordered lane row]; cded11f fix(agents): deliver a child's end state as parent history, not a turn obligation (#204178) [not selected for this narrow backport]; 92e92d7 fix: preserve restarted child results and gateway test ownership (#203839) [not selected for this narrow backport]; 09d956b fix(subagents): wake a yielded requester for each ready child result (#203176) [not selected for this narrow backport]; 9f35510 fix: retain child results behind live requester turns (#203198) [separately ordered lane row]; c23cd7f fix: preserve private child results during restart (#203156) [separately ordered lane row] Release adaptation: Keep stable requester fixture setup and insert the two consumed/unconsumed restart cases without moving its existing lost-yield test. Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 9f35510) Companion audit: #203222 fixes yield settlement after cleanup, #203176 wake scheduling, #203839 restart fixtures, #208469 newer perf harness; remaining same-path commits change orchestration or history delivery and are not inputs to stable expiry ownership. Co-authored-by: RomneyDa <[email protected]>
Problem
A requester that calls
sessions_yieldafter spawning several completion-mode subagents was woken only when every member of the frozen yield batch was ready. A sibling that keeps running, or that pauses on its ownsessions_yieldwhile a background command runs, held every finished result back.Production incident (2026-11-21): a dashboard parent spawned 3 children and yielded at 16:20 IST. Two children finished at 16:26:58 and 16:29:41 with reports that needed a decision. The third kept cycling through exec-yield and resume. The Gateway log has no
announce:requester-settle:…run for that parent. The parent ran again only at 18:32, when the user typed into the chat. A copy of the state database shows why: both finished rows wereterminal/okwithdelivery.status: pendingand a pendingrequesterSettleWake(batchRunIds= all 3,rearmGeneration: 1). The third row was stillrunning. The gate insubagent-announce.requester-settle-wake.tsreturnedfalseunless every frozen member passedisRequesterSettleMemberReady. #200967 had already made an exception for siblings that wait for a message. An exec-yielded or running sibling is the same bug class.Change
Rule: every ready result wakes the yielded parent. Siblings that are still working keep their wake, with the same
rearmGeneration, and wake the parent again when they finish. Each result is delivered once.isEndedSubagentMessageWaitis deleted). The wake delivers the ready members of the frozen batch as one partition, and lists the members that are still working. A member whose partition has already started dispatch records its own batch, so a later partition never offers it again. When a partition holds only results that were already delivered and siblings are still pending, it settles without a redundant wake.sessions_yieldto wait; otherwise act on the ready results without reporting the batch as finished.offeredBatchnow offers only ready members, so failure settlement can never consume the wake of a sibling that is still running or exec-yielded.afterReleasenow schedules the settle for the finished child. Before, nothing woke the parent until the sibling ended.sessions_sendwait-for-reply,agent-step, nestedagent-run-subagent): the caller is waiting for a single reply. Only the partition that leaves no member pending continues the followup. Earlier partitions wake the session as ordinary settle turns.successor()accepts that last partition as a subset of its cohort, so it no longer throws and records the result as a permanent failure.NO_REPLY) and wait. Such a turn is not treated as a missing visible reply, so it is not retried.isRequesterSettleMemberReadymoved tosubagent-run-liveness.ts, its only owner, and replaces the deleted message-wait predicate.tools/subagents/announce.mdandconcepts/subagent-yield-handoff.md.Product decisions, under the rules "no stranded user" and "no false done":
Evidence
Regression test (
subagent-registry.requester-wake.e2e.test.ts, real registry, lifecycle, yield tool and wake entry point): spawn 2 children, yield, finish one, keep the other exec-yielded. The parent is woken with the finished result, and the wake names the working sibling. The sibling's continuation then wakes the parent again with only its own result. A sweep adds no third wake. A second case covers a child that ended before the yield, while the requester's turn held it.eb7ca3d33375: both cases red (expected [] to have a length of 1: no wake).Owner tests: cron authority (
requester-cron-authority.test.ts: the early partition neither borrows nor consumes the authority, and the last partition is admitted with it), followup partition (subagent-announce.requester-settle-followup.test.ts: early partition runs with no followup successor, last partition carries it). Goal partition (goal-continuation.test.ts: early partition does not resume the Goal, last partition resumes it once).Updated tests that asserted the all-at-once rule:
requester-settle-cross-turn(paused member),subagent-control.workerprogress card (one wake per result; the card retires once),requester-wake-settlement(stopped child).Real-Gateway E2E, incident shape. Scratch
ocx srcGateway underenv -i, OpenAIgpt-5.5on the OpenClaw runtime. Parent spawnsalpha(replies at once) andbeta(execwithbackground: truerunningsleep 90, thensessions_yield), then yields.announce:requester-settle:…:<alpha>:yield-1)…:<beta>:yield-1)The parent's replies on head were
alpha: ALPHA-RESULT-7, thenalpha: ALPHA-RESULT-7 / beta: BETA-RESULT-9. The live Peanutto launchd pid andopenclaw.jsonhash did not change.Live sibling suites (
subagent-yield-pause,subagent-followup-yield,subagent-yield-resume, real OpenAIgpt-5.5): the same tests fail on baseeb7ca3d33375and on this branch, with the same assertions (missingcompletion.resultTextafter a resumed or paused child completes, a Gateway shutdown timeout, an interim reply in the follow-up watch case; follow-up-yield failed 2 of 2 on base). One run of this branch showed a parent that wrote its final report as soon as the first result arrived; the wake message now says to keep waiting when the request needs the remaining results, and that failure no longer appears. The real-Gateway restart e2e files (test/gateway-*-restart*.e2e.test.ts) fail locally on base too (11 of 26 on base, 9 of 26 here, same assertions).Gates:
pnpm tsgo:core,pnpm check:test-types, oxlint and oxfmt on the changed files. Every test file insrc/agents/subagentsandgoal-continuation.test.tswas run across the unit-fast, infra, agents-support, spawn-boundary, core-isolated and e2e projects. Two infra tests failed once under host load and passed when run alone, on head and on base.Size
Production code is +96 / −56. The gate, the message-wait exception and its predicate are deleted. The added lines are the partition support the old gate did not need: pending members in the message, the followup last-partition rule, Goal cohort shrink, and pre-yield scheduling, and cron-authority cohort shrink. A census of
batchRunIds,requesterYieldBatch, the frozen branch andselectConnectedSettledSubagentWavefound every remaining reader still in use. v8 coverage could not attribute lines under the compiled-worker test runner (0 files collected in two attempts), so the census was done by reading the code.Accepted edge cases
Merge danger