# Proof for [#20835](https://github.com/pingdotgg/t3code/pull/20835)

Reviewed head [d9b6d2460d](https://github.com/pingdotgg/t3code/commit/d9b6d2460d360d48f298c72d71d861df81cb6b33), pinned base [1451e7cb23](https://github.com/pingdotgg/t3code/commit/1451e7cb23034d29774338608368a15d8845df36). Contributor history preserved with a normal main merge. Original work by @juliusmarminge, retained in this PR.

## Before and after

An existing background owner launches a nested agent while Claude's root is idle. On main the launch stays buffered until another root run. On this head it immediately publishes under its still-running owner's original run/root/provider turn, including after a later completed root. Progress and completion keep that attribution. Interrupted/failed owners retain the safe buffer/wake path.

Fresh Astra reduced the PR's original 375 added test/fixture lines to312; a confirmed independent-review attribution regression then strengthened the same completed-owner case. Final371 added lines in the same3 existing files,4 added unit cases unchanged,1 existing recorded replay strengthened. Main tests outside the added blocks preserved. No sleeps or polling introduced.

Main-production reversal: completed-owner adapter and late-child routing cases fail, interrupted/failed-owner controls pass; named nested persistence replay fails. Removing the rebuilt stopped-owner outcome guard makes both stopped-owner controls fail. The round-one implementation then exposed a provider-turn mismatch: a fresh regression failed1/4 cases. Retaining the owner provider turn makes4/4 pass; an update-only mutation keeping initial attribution correct but using the latest context on progress/completion fails1/4, then restoration passes.

Current-head focused checks: adapter289 + routing55 =344 unit passes. Recorded Claude replays34 pass/110 intentionally unselected, including nested-wake replay. Total378 unique passes. Server-only typecheck:0 errors/0 warnings. Scoped lint passes with one baseline unused-layer warning; scoped formatting and git diff --check pass. Opus independently repeated344 units and34 replays; Sol independently repeated4 focused cases and named persistence replay.

## Integrated Linux proof

Primary reran the named native recorded replay at this head:1 pass/143 unselected. An external Vite transform captured the actual persisted scenario result without tracked source edits. Grandchild event indices: row49, thread50, completion63, all before root-wake-start82. Assertions require two completed root runs and only CHILD_DONE causing the root wake. This recorded scenario has one owner run plus its wake; the multi-root-turn attribution scenario uses synthetic adapter frames.

With own dev server stopped, imported captured projections through the SQLite fixture helper into isolated sandbox state, mapping only the project association. Event log left unchanged. This is presentation proof, not another backend behavior test. Restarted sandbox and queried authenticated protocol2 bounded snapshot:HTTP200, two completed subagents on owner run, both cards on owner provider turn. Browser accessibility exposes ROOT_STARTED, both nested cards, CHILD_DONE and ROOT_WAKE_DONE. Opening the grandchild card navigates to its real sandbox thread, showing GRANDCHILD_DONE., Completed status and Open parent. No model invoked or live userdata changed.

Screenshot captured and inspected: text glyphs render blank throughout this headless client, with collapsed text boxes. The image is unusable and omitted. API/accessibility and deterministic test evidence are supplied; no visual approval is claimed.

## Review and limits

Two fresh independent whole-PR rounds, Codex gpt-6-sol and Claude claude-opus-5-5. Round1 Sol found wrong provider-turn attribution, fixed and proven through start/progress/completion; round2 both clean. The older CodeRabbit stopped-owner finding was rechecked and remains fixed. A tiny shared root-outcome object replaces the original retained historical Set; one scalar retains the owner provider turn. Exact live-node enrollment permits late child-thread adoption and revokes on terminal/foreign attribution.

Keeping provider turns also makes an ordinary background owner's card keep its launch turn when it updates during later runs; web/mobile grouping becomes consistent with its run ID. No new contracts, API or client controls.

Still buffers when a later interrupted/failed root has removed settled context. Reviewers noted an unproven low-severity subscription-before-turn-attachment adoption window; no new defect reproduced, and the comparable workflow window predates this change. Old root-node attribution on resume and old-run subscription cleanup are pre-existing. Stop timeouts/held-message drain are outside scope.

Not verified live: authenticated Claude SDK nested launches, real provider timing/new-run attachment race, macOS, Windows, Electron desktop, iOS or Android. No recorded multi-root-turn persistence transcript. Current-head CI is assessed separately on the PR; local checks alone do not establish readiness.

Tests: Codex gpt-6-astra high. Implementation: Codex gpt-6.1-sol high. Reviews: Codex gpt-6-sol high and Claude claude-opus-5-5 high. Harness: T3 Code.
