## Scope
Sixth standalone extraction from #655, directly on current `main`
(`fe3ae92`) after the live core #682 landed. **16 files, +864/-50**,
mostly direct tests and snapshots. No negotiation, capability,
dependency, or generated app-server changes.
Enhances only the existing standard-subagent path: non-AIR v1 still
requires client opt-in; non-AIR v2 uses it by default. AIR retains its
separate replay and identity rules.
## Changes
- Follow both recorded `subAgentActivity` and collab spawn formats,
replaying each conversation once, recursively under its immediate
parent. Resolve recoverable reversed ancestry, bound cycles, and never
guess or change parentage.
- Read legacy or paginated child items lazily. Current-provider
ownership verification and live subscription restoration happen before
item reads. A retained transcript remains displayable without granting
ownership or current work state.
- Send all selected history before the load/resume response, preserving
the live core's actual batch-write freshness boundary.
- Reconcile tool/rendering bookkeeping before suppressing duplicate
presentation. Replayed completed tools cannot be failed by later cleanup
or resurrected by stale running snapshots. Live completion bookkeeping
still runs, and completed runnable items do not leave a live permission
incorrectly reported as running.
- Restore in-progress command classification without resetting
streamed-byte tracking. Duplicate live starts do not reset the reporter,
and completion does not resend already streamed output.
- Report known gaps once at the parent while continuing available
sibling replay. Reject mismatched thread identities. Empty history alone
invents no gap, ending, failure, or runtime.
### Conservative limits
Agent-owned input is not reinterpreted as human input. Incomplete text
snapshots have no safe delta cursor and are omitted rather than
duplicated over newer buffered deltas; unfinished command replay carries
metadata rather than previously streamed bytes. Only renderers with a
safe partial form are used for unfinished items. Open-ended provider
status strings (such as image generation status) are not treated as
completion enums: those items use recorded completion metadata instead,
with legacy and paginated regressions. These omissions produce an
advisory. Complete retained content is replayed normally.
Historical work-state outcomes, directed-session messages, new child
controls, and broader configuration reporting remain deferred. Existing
provider-parentage checks still prevent copied fork history from
stealing the original runtime.
## Coverage
**36 new v1/v2 cases** cover both spawn formats, one visit per
conversation, nested/reversed ancestry, paginated item ordering,
missing/mismatched snapshots, completed-tool reconciliation,
running-command restoration, incomplete-text overlap, stale running
history, live permissions, cyclic records, close-during-read, and
no-replay behavior. Wire assertions verify recorded content precedes the
response; no recorded permission or elicitation request is reissued.
Real-Codex integration cases now reload finished children and assert
that their retained answers replay under the same child IDs, on v1 and
v2. The existing fork/cancel/close/terminal-lifetime checks remain in
place.
## Validation
- `npm run typecheck`
- `npm run build`
- `npm test`: **1,995 passed**, 38 skipped
- Focused live/replay suites: **77 passed**, 2 v2-only cases skipped on
v1
- `npm run test:integration`: **15 passed**, with the real Codex 0.164.0
app-server and a local scripted model
- `npm run bundle:all`: all six targets compile
- Live-model no-tool smoke completed with `end_turn`
- `git diff --check`
Existing golden files are unchanged. One live-core assertion changes
intentionally: an empty retained transcript no longer produces the
blanket “child transcripts are not included” advisory. New replay cases
verify advisories for actual failures and incomplete/omitted content.
The full live-model E2E suite and execution of every OS bundle were not
run. Native integration uses the default provider history store;
explicit paginated-branch coverage uses SDK-level fixtures.
## Contract references
ACP specification `53620d0b325d6815b3cff1ca7e909351d488fdf0`:
[best-effort replay, per-session identity/order, gaps, and
freshness](https://github.com/agentclientprotocol/agent-client-protocol/blob/53620d0b325d6815b3cff1ca7e909351d488fdf0/docs/rfds/subagents.mdx#L713-L836).
Official TypeScript SDK `c7e07388feed7a530f8211d0dae4951cb6d26d09` /
published 2.0.2 is runtime evidence, not the normative contract.