Most added lines cover regressions and move formatting beside exact-run reads; archived histories now stream through the existing storage worker.
## What Problem This Solves
Completed child answers could lose required fields before their parent read them. Closes#138555. Reported by @aleps001.
## Why This Change Was Made
The parent receives the complete visible final answer from the selected child run, including its registered deletion archive. Descendant results remain input to the child's synthesis. A persisted final message-tool reply remains authoritative after a later same-run `NO_REPLY`.
The shared 4,096-character terminal snapshot stays bounded for lifecycle and durable evidence. This state has one writer. Stored shapes, retention, and cleanup ownership are unchanged. Complete answers use more parent context. The owner's September 15 decision replaces projection limits from #119731 and #124171 while preserving escaping, metadata limits, stable order, and whole-item queue delivery.
## User Impact
Waiting and returning parents receive complete answers while the exact-run transcript remains retained. If archive pruning has removed it, that completion uses its capped published result with a `truncated-by-retention` marker. Healthy siblings and the parent continue. Public and private nested children forward their own conclusions. Large archived histories no longer require one decoded string on the Gateway thread.
## Evidence
An 8,638-character answer lost its required tail on the baseline. Served Chat now delivers all 11,758 escaped characters to the resumed parent and retains them after child deletion. A public nested case delivers the middle child's distinct conclusion. Earlier aggregate, nested-yield, and ordinary completion captures also pass.
The registered `maybeWakeRequesterAfterAllChildrenSettled` regression uses capped visible terminal evidence and a complete >4,096-character exact-run transcript with a trailing same-run `NO_REPLY` row. It fails on the original implementation and passes here. The producer contract is covered by [run-entry-terminal.ts](a97d75a928/src/agents/embedded-agent-runner/run-entry-terminal.ts (L153)) and [run-entry.test.ts:928–931](a97d75a928/src/agents/embedded-agent-runner/run-entry.test.ts (L928)). Native children cannot call `message` under the existing hard deny, so that live cell is excluded.
A returning parent can receive a kept child’s answer and then continue after that child starts a valid follow-up. The registered tool-result continuation fails on `a97d75a9` and passes here. Initial source rejection, parent cancellation, and pre-prompt compaction remain covered.
The registered `attempt-prompt-submit.retention.test.ts` regression publishes and prunes a child archive, then consumes deferred results through the real parent session (`node scripts/run-vitest.mjs run src/agents/embedded-agent-runner/run/attempt-prompt-submit.retention.test.ts`). It fails before the correction and passes with the marked retained result, the healthy sibling’s complete answer, cleared delivery leases, and a successful next parent turn.
[Scenario and captures](https://gist.github.com/obviyus/cce960c04dafd949c21141686af3696e).
| Before | After |
| --- | --- |
|  |  |
## Compatibility
No public API, schema, retention, or retrieval feature changes. Archive hash, header, session, and owner checks remain. The existing worker scans a 536.9 MB decoded archive whose previous whole-string decoder failed.
## Consumers
Requester settlement, deferred turns, nested announcements, event projections, and retained parent history use the complete result, or the marked retained snapshot when its exact answer is unavailable.
## Invalidation
Run, producer, generation, batch, requester, and lease authority are rechecked after reads and before delivery. Failed prompt assembly releases its lease. Deferred source validation ends after the first foreground stream is acquired; parent abort checks remain active.
## Tests
The retained complete-result proof covers 374 tests across 15 files, including the format suite. The retained owner and sibling proof covers 379 passing tests across 17 files on a fresh merge with main, including the format and retention regressions. Four additional consumer suites update their explicit session-accessor mocks for the exact-run reader; their 286 tests pass on a fresh merge with main, with behavior assertions unchanged. Registered settlement, deferred-input, and continuation regressions fail on their original source. Type-aware preflight, structural checks, and test registration pass.
Production growth is 422 lines: result +241; output −130; queue +27; registry API +8; prompt build/phase/submit +6/+1/+16; wake/message −44/+54; announce +13; events −16; archive read/session/types/dispatch/worker/history +183/+6/+14/+20/+9/+11; history export +3. Growth accepted under the owner's standing acceptance (2026-09-15).
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix: finish yielded tasks and attribute child failures
* test(codex): control model attribution timeout and cleanup
Adopt the test-only cleanup repair from #149274 and assert the canonical timeout result. Production deadlines and cleanup behavior are unchanged.
Keep private results under the spawning turn until it settles, then resume
individual review or the existing yielded batch. Fence late failed announcements
without discarding committed delivery receipts.
The real Gateway regression reproduces the false parent failure before this
change and passes with one processed result afterward. Three requester-owner
E2E cases, 280 lifecycle/recovery tests, and changed-file checks pass.
Related: #147206, #147571, #146667.
Fix collector runs that yield without delivering a collected result.
Settle ordinary collector yields through the existing completion owner, while
preserving explicit timeout and blocked outcomes. Keep ordinary subagent
continuations unchanged and retain the original contributor's implementation.
Related: #141474
Co-authored-by: Mitchell Etzel <etzelm@live.com>
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
* feat(agents): inject Recently Completed Subagents into parent prompt
The parent prompt showed only active children, so a requester whose child
had already finished saw nothing about it on later turns and could
re-spawn the same task. `buildSubagentList` already computes a `recent`
window; nothing rendered it.
Render it as a second bounded prompt block beside `Active Subagents`,
reusing the same sanitized/JSON-quoted entry formatter. The block is
capped at the newest 8 entries within the existing `recentMinutes`
window, sorted by end time so the text is deterministic across turns and
bursty sequential work cannot grow later turns without bound.
Guidance text is fixed rather than varying by entry status, so the system
prompt stays byte-stable for prompt caching.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(gateway): prove recently-completed parent prompt on an isolated gateway
Restore the category docs contract the rebuild accidentally reverted, and
record the later-parent-turn isolated-gateway verdict ClawSweeper asked for.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(agents): assemble recently-completed prompt through attempt-history
ClawSweeper rejected calling the builder from the gateway test. Drive the later parent turn through prepareEmbeddedAttemptHistory so the isolated-gateway verdict is the assembled system prompt.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(gateway): prove recently-completed block on a real parent model turn
ClawSweeper rejected helper assembly and fake session-manager doubles. Drive two parent agent.wait turns through an in-process gateway and mock OpenAI, and cite the later model request.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(gateway): keep recent-subagent proof within shard budget
* fix(agents): scope retained-result context reads
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: eric <ericstudio@ericdeMacStudio.lan>
Co-authored-by: Jason (Json) <263060202+fuller-stack-dev@users.noreply.github.com>
* fix(agents): recover yielded subagents and preserve sidebar nesting
Defer sessions_yield until earlier async tool results have reached a subsequent model request, preventing a child from pausing before it can consume completed output.
Resume paused children through the existing adoption owner so task identity, requester, and parent completion batches survive operator follow-ups. Keep subagents beneath their expanded navigation parent even when categorized, and show their task names in activity rows.
Validation: async-yield, sessions.send recovery, lifecycle, and sidebar regressions; scoped production/test typechecks, lint, consistency checks, and independent review passed.
(cherry picked from commit 3086b77b6ce7edd25d0964b1f3559dea296e4d12)
* fix(gateway): preserve admitted follow-up task ownership
Keep plugin and settlement adoption with admission while allowing explicit operator recovery. Exercise requester preservation through dispatch and retain retryable approval handoffs on admission failure. Align the existing browser cache assertion with the fingerprinted sandbox shell from #146602.
* fix: clear stale subagent activity after restart cleanup
Settle orphaned native runs through canonical completion before cleanup, keep task-write failures retriable, and reconcile previously stranded registry-backed tasks without hiding live work.
Closes#146224
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
* test: retain the cancellation race during task settlement retries
Keep the exact failed-task write fault active until cancellation publishes its result, then release it without weakening generation, cascade, or successor assertions.
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
---------
Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
* docs: correct verified accuracy defects in CLI, tools, and automation pages
Resolve the open `accuracy` audit findings for docs/cli/, docs/tools/ and
docs/automation/. Every claim was checked against the implementation before
the prose was touched; findings the source contradicted are left unchanged and
rebutted in the PR body.
Factual corrections (docs disagreed with code):
- onboard: Z.AI defaults are glm-5.3 (coding) and glm-5.2 (general), not
glm-5.2/glm-5.1 (extensions/zai/model-definitions.ts, openclaw.plugin.json).
- sessions: the cleanup --json example printed a sessions.json store path, but
both JSON exits map storePath through resolveSqliteTargetFromSessionStorePath
(src/commands/sessions-cleanup.ts, src/config/sessions/cleanup-result.ts).
- diffs: `plugins install diffs` resolved to an unrelated npm package; the
plugin is external, not bundled (extensions/diffs/package.json).
- ollama-search: a bare "OLLAMA_API_KEY" string is a literal key, not env
indirection (src/config/types.secrets.ts).
- minimax-search: the region list contradicted its own opening condition and
merged two tiers (extensions/minimax/src/minimax-web-search-provider.runtime.ts).
- imap: addressTokens is a per-account key (extensions/imap/src/config.ts).
- thinking: GLM-5.3 is a second Z.AI exception (extensions/zai/provider-policy-api.ts).
- video-generation: buffer-backed videoToVideo also covers fal reference-to-video
(src/video-generation/live-test-helpers.ts).
- slash-commands: the missing third source is skill commands
(src/auto-reply/commands-registry-list.ts).
- cron: `cron` is the registered command and `automations` its alias
(src/cli/cron-cli/register.ts).
- setup: add the real --classic and --agent-name flags to the Options table
(src/cli/program/register.setup.ts).
- path: file-slot wildcard rejection exits 2 (extensions/oc-path/src/cli.ts).
Version scope added only where a release could be cited: 2026.8.1 (heartbeat
task migration, inferred commitments, artifact-area staging), 2026.4.29 (owner
bootstrap), 2026.4.26 (Hunter Alpha), 2026.3.31 (nodes.run). Elsewhere the
time-relative wording is replaced with the verified current behaviour rather
than a guessed version.
* docs(swarm): keep the limits-and-roadmap anchor after the heading rename
docs/AGENTS.md requires existing published heading ids to stay stable. The
rename from 'Limits and roadmap' to 'Limits' changed the generated fragment,
so add an explicit <a id="limits-and-roadmap" /> stub above the heading.
parseDocsDocument now reports both ids with no collisions.
docs/tools/subagents.md was 54,144 characters mixing reference, how-to, and
explanation. Move each H2 block verbatim into docs/tools/subagents/ and keep
the parent as an orientation index.
Every pre-split anchor id (75 of them, including component ids minted by
Accordion, Step, and ParamField titles) is preserved as an authored stub on
the index, because redirect sources cannot carry a fragment.
Closes r3-0797.
Co-authored-by: Vincent Koc <vincent@openclaw.org>