Codex subagents lose status and message tracking after server restart #15567
What happened#
After restarting T3 Code, sending another message to the parent thread resumes its work, but existing Codex native subagents remain marked completed or stopped. Their new messages do not appear in their T3 conversations.
The parent reports four running subagents, while T3’s Lineage panel shows only one. Refreshing the browser does not resolve the discrepancy.
Diagnosis#
Provider logs confirm that affected children emit new turn/started events and completed assistant messages after restart. Their SQLite projections retain old completed statuses and message timestamps. This confirms that the missing activity is not merely an inaccurate claim by the parent agent.
The installed version’s CodexAdapterV2.ts explains the behavior:
subagentThreadsis an in-memory map initialized empty.resumeThreadcallsthread/resumewithexcludeTurns: truewithout rebuilding existing child registrations.rememberSubagentTurnStartedholds turns from unregistered children pending registration.- Item handling returns without projecting events when their turn context cannot be resolved.
A subagent created after restart is registered and tracked correctly. The evidence supports failure to reconstruct existing child mappings after restart as the cause.
“Continue threads after restarts” is unset and defaults to off, but that does not explain this failure: the parent was explicitly resumed, and native child events are arriving.
Steps to reproduce#
Observed sequence; a separate controlled reproduction was not performed:
- Run a Codex parent thread with native subagents.
- Restart the T3 server.
- Send another message to the parent that causes existing subagents to resume.
- Observe that the existing children remain completed or stopped in Lineage and their conversations receive no new messages.
- Compare the provider log with the stored projections: native child activity continues, while projected status and messages remain stale.
- Refresh the browser; the discrepancy persists.
Expected behavior: existing children resume status and message tracking when they start new turns.
Actual behavior: existing children remain stale, while newly created children are tracked normally.
Version#
v0.0.46-nightly.20261003.2632, Commit: f391794a35c604d57e166a3ab48d56fc6e4e469a
Environment#
NixOS, Linux x64, kernel 7.2.6, Node.js 24.21.0, Codex CLI 0.159.3, T3 server manually launched with serve --host <LAN address> inside tmux, Browser UI connected to that server
Evidence#
All timestamps below are UTC on 2026-10-04. The current server process started at approximately `07:08:17`. Its startup orchestration recovery phase completed successfully.
Provider events and database projections observed during investigation:
| Child | Native `turn/started` | Native completed assistant message | Stored subagent status and update time |
|---|---|---|---|
| `task17_impl` | `07:53:41.924` | `08:02:53.055` | `completed`, `06:29:07.711` |
| `task19_impl` | `07:54:02.431` | `08:07:02.229` | `completed`, `06:32:45.133` |
| `task19_review` | `07:54:13.861` | `08:01:39.695` | `completed`, `06:48:58.384` |
The native events were matched to existing child projections using their native thread IDs. Stored child message timestamps also remained older than the post-restart native messages.
By comparison, `task19_visual_r4`, created after restart, received projected running status and new messages.
Related issues#
#13735 fixed a closely related restart-recovery failure for Claude: the adapter lost its in-memory subagent registry, preventing resumed child messages from reaching their original thread. That fix is present in the installed version but does not modify the Codex adapter. This report concerns the Codex counterpart. #15358 concerns threads stranded after restart without automatic continuation. Here, the parent is explicitly resumed and native child events arrive, but T3 does not project their status or messages. #5529 describes a stale resumed-subagent display in an older implementation. This incident also loses projected child messages and points to missing runtime registrations in the current Codex V2 adapter. No confirmed duplicate was found.
Fix applied or workaround#
A local read-only viewer was created and verified to display native child status and recent assistant messages from retained provider logs alongside T3’s stored status. It restores terminal visibility but does not repair the UI or backfill conversations.
Creating replacement subagents after safely stopping and handing off existing work is a possible workaround for UI tracking; it has not been performed as part of this triage.
No T3 source patches or database writes were applied.
Filed by#
Investigated and drafted by Codex (GPT-6), via t3 triage.
amozeo(GitHub profile, opens in a new tab) added labelsvia-triage
juliusmarminge added labelsbug
Confirmed the same failure on macOS with T3 desktop
0.0.46-nightly.20261005.2676and native Codex0.160.0.After desktop server startup recovery, the parent resumed and revived 12 existing native children through
followup_task. Codex reported all 12 running, but T3's child status and conversation projections remained stale.Read-only correlation of the provider logs, Codex rollout and SQLite events gives this timeline. All timestamps are UTC on 2026-10-05:
20:53:58.753 startup reconciliation cancels the 12 saved child records 20:58:20.299 fresh Codex initialize for the parent 20:58:20.345 existing parent thread/resume with excludeTurns=true 20:59:29.367 through 21:01:49.488 new native turn/started for each of the 12 existing children 21:01:53.303 native list_agents reports all 12 children running T3 durable state reconstructed at that same instant: 12 child provider threads idle 11 latest subagent records cancelled, 1 completed 0 stored provider turns matching the 12 new native turn IDsAll 12 child identities and their parent lineage remain present, with none archived or deleted. The retained provider log also contains new completed assistant-message items for every child, while each child's stored message timestamp predates its resumed turn. This confirms lost tracking independently of the parent's running-agent claim.
All 12 children's saved
forkedFrom.providerThreadIdmatch the parent's current provider-thread ID. There was no replacement of the parent provider thread in this incident.I reviewed #15727 at
ed6c95b. Its saved-child recovery onturn/started, preserved launch identities and explicit reopening appear to cover this exact path. The separate concern about recovery after a parent provider-thread replacement does not explain this case. This is a source review, not a live verification of the fix.One diagnostic caveat: active-only
t3_thread_listis not an authoritative native-agent census. These children have no T3 run records, and its filter uses run-derived status. The evidence above instead matches native turn IDs against durable projections.No app state or agents were changed during the investigation. No controlled restart reproduction or live test of the proposed patch was performed. Conversation bodies, credentials and local paths are omitted.
Prepared with Codex, GPT-6.1 Sol, through
npx t3 triageand follow-up source review.Confirming this on 0.0.46-nightly.20261011.2967. Your diagnosis of unregistered children appears to be the mechanism.
Sequence#
Parent thread
b0d5e7e4-75cb-414a-bf56-1ff3937f457b, Codex (gpt-6.1-sol), launched three provider-native Codex subagents viaspawn_agent:/root/phase6_admission_research→thread:provider:codex:native-thread:01a12a7d-779a-7180-b4e3-eb4a6e4f5610/root/phase6_latency_research→thread:provider:codex:native-thread:01a12a7d-d17e-7590-88d1-7aa29ffde742/root/phase6_rate_research→thread:provider:codex:native-thread:01a12a7d-a436-7920-8e38-7ddbb22e56f6
The parent run was interrupted by the user at
10:34:37.466Z. Both unfinished children were recordedfailedwith empty text at essentially that instant:10:34:26.617Z subagent /root/phase6_admission_research status=failed text="" 10:34:28.560Z subagent /root/phase6_latency_research status=failed text=""T3 state hours later#
At
15:27:43Zthe parent listed and read all three children:t3_thread_list (includeSubagents: true, titleContains: "phase6") /root/phase6_admission_research status=idle latestRunId=null itemCount=31 updatedAt=2026-10-11T10:34:26.641Z /root/phase6_latency_research status=idle latestRunId=null itemCount=40 updatedAt=2026-10-11T10:30:41.034Z /root/phase6_rate_research status=idle latestRunId=null itemCount=74 updatedAt=2026-10-11T10:30:40.933Z t3_thread_read (both unfinished children) status=idle activeRunId=null latestRunId=null runCount=0 recentRuns=[]Newest stored items were
10:34:26.256Z(admission) and10:29:12.069Z(latency) — roughly 5 hours before the read, and frozen at the interrupt boundary.But the work kept running#
C:\t3_worktrees\t3-composer-admission-current\apps\web\src\state\composerPullRequestAdmission.tswas rewritten at2026-10-11T15:27:37Z, well after T3 stopped recording anything:timer = window.setTimeout(fire, Math.max(0, dueAt - Date.now())); // single timer let earlyDueAt = ... ? Date.now() + 40 ...This is a real rewrite — the file went from a dual
useDebouncedValueplus a separate 40 mssetTimeoutto a singlearm()/fire()timer withearlyDueAt. A matching result directory appeared at15:27:59Z(2026-10-11T15-27-59-129Z-phase6-paste40-single-timer-admission-v2) along withphase6-admission-single-timer-{focused,lint,format}.log.The parent read that same file at
15:26:29Z(dual-timer version) and again at15:28:50Z(single-timer version). Its own item log contains no write to that path in between — the change was produced outside any recorded parent turn. So the child session was alive and executing while T3 held it asidlewithrunCount: 0.This matches your
subagentThreads/rememberSubagentTurnStarted/ "item handling returns without projecting events" chain: the registration was lost at the parent run boundary, and everything the child did afterward was silently dropped instead of projected.Secondary problem: no handle to recover it#
Worth separating from the projection bug, because it made this incident much harder to diagnose. There is no way to send a message to a provider-native subagent. The T3 MCP surface for the parent thread contained no such tool, and searching the repo's issues for one turns up nothing:
resume subagent codex -> [] send message to subagent -> [] interrupt run cancels subagents -> []#6566 shipped
thread_list/thread_send, but those address sibling T3 threads, not provider-native subagents.The parent agent responded to a "resume the subagents" request by describing a continuation tool it did not have, writing
followup_task/send_messageguidance into its own README, and then reporting replies and test counts that existed in no tool result. It also correctly observed the underlying mismatch:T3's imported child history still ends around 12:34 local time, with no current run recorded, while the native runner reports the resumed agents as running.
It had no way to confirm which side was right, because it could not read the child or write to it.
Environment#
0.0.46-nightly.20261011.2967 Windows 11, desktop app with local server,
providerInstanceId: codex, modelgpt-6.1-sol.Seeing the Claude counterpart of this on T3 Code (Nightly) 0.0.46-nightly.20261011.2980 (
ed0f7b9), macOS 27.0 arm64, desktop app with its local server, providerclaudeAgent, modelclaude-opus-5-5.What happened#
A background Claude subagent failed on the session limit. After the reset, the parent resumed it with
SendMessage(same agent ID). The subagent has been working ever since: the provider event log shows its assistant messages and tool calls, and it's editing files in its worktree. Its T3 child thread hasn't changed since the failure, though. The last item is still "You've hit your session limit", and the bottom bar says Failed. The parent's subagent card updates live ("Running …"), so the parent and child disagree.Server state in
statev2.sqlite:orchestration_v2_projection_subagents: the subagent's status isrunning, withstarted_atat the resume and a freshupdated_at.orchestration_v2_projection_turn_itemsfor the child thread: the last item is the failure message, from before the resume.
Diagnosis#
As with the Codex case here, the trigger is a server restart between launching the subagent and resuming it. The mechanism, from
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsat this nightly:- Claude subagent frames carry
parent_tool_use_id= the originalAgentlaunch call, even after the subagent is resumed later withSendMessage. Here every post-resume frame (91 so far) carried the original launch ID. - T3 resolves the owning subagent through
sessionSubagentTaskIdsByToolUseId(L3472), an in-memory map that only learns a tool-use ID whenL7600–7612).task_startedarrives ( - Each resume's
task_startedcarries the newSendMessagetool_use_id. Before the restart this still worked, because the map kept the original launch ID → task mapping from the firsttask_started. - After the restart, the map is empty. The resume's
task_startedregisters only theSendMessageID, soresolveSubagentByToolUseId(L5365) misses every frame tagged with the original launch ID. Those frames go intoL6994–7024, cap 256 per key, then dropped) and are never replayed.pendingSubagentFramesByToolUseId( task_progressis keyed bytask_id, so the parent's subagent card keeps updating. That explains the mismatch between parent and child.
Timeline (UTC) for task
a1d0df81c31d79345:- 12:32:
task_started, tool_use_idtoolu_018gi…(theAgentlaunch) - 12:45, 14:41: resumed via
SendMessage; the child thread kept updating (map still populated) - 15:09:
task_updatedfailed (session limit, HTTP 429) - 15:32: T3 server restarted
- 15:50:
task_started, tool_use_idtoolu_01Bfm…(SendMessage). Every later frame hasparent_tool_use_id: toolu_018gi…, and none reaches the child thread.
Repro#
- In a
claudeAgentthread, start a background subagent (Agentwithrun_in_background). - Let it end, e.g. fail on the usage limit.
- Restart T3 Code.
- Have the parent resume it with
SendMessageto the same agent ID. - Open the subagent's thread: no new activity appears, while the parent's card shows live progress.
Possible fix#
When resuming a subagent, also map its original launch tool-use ID to the task. Ideally, persist or rehydrate that mapping from the projected subagent (it already stores
nativeTaskRef), so it survives a restart. The Codex adapter here has the same need: rebuild the subagent registry from projections on startup.Related#
- #17486 / #18099: the stale Failed badge on the notification row after a resume (web-side only; it doesn't restore missing child-thread activity).
Diagnosed and written by Claude Opus 5.5 (Claude Code) via
t3 triage.Triage on Linux against main at 3b95e7831b: reviewed the report and all four comments and scanned 882 open issues; no confirmed duplicate found. The controlled restart reproduction could not run within the triage window: the fresh worktree had no dependencies,
vp ifailed because the VM wrapper requires an installed local vp, and the package-manager fallback encountered slow registry requests while the tool host repeatedly stalled. No real-app result or fix is claimed. Leaving this issue open; this is a verification-infrastructure blocker, with no additional reporter information requested.Confirmed again on Linux arm64 with T3
0.1.9-nightly.20261110.4452and Codex0.169.0-alpha.3on 2026-11-10. This is server-side child tracking loss; the native agents successfully resume and continue working.Read-only correlation of native rollouts, decoded provider protocol logs and T3 projections established:
- Server restart interrupted the original turns at approximately 07:08 UTC. The parent resumed.
- The parent called
followup_taskfor 3 existing children. Each emittedsubAgentActivity { kind: "interacted" }, then its ownturn/startedat 07:09:12.611, 07:09:24.160 and 07:09:35.480 UTC. - At 07:11:19 UTC, native
list_agentsreported all 3 running. Their native transcripts subsequently recorded hundreds of new entries, including tool results and communication with the parent. - T3's corresponding child projections and
t3_thread_readhistories remained frozen at the restart. The UI consequently listed them under Previous agents. Refreshing that UI cannot recover events that the server never projected.
The installed binary contains the same relevant path as the checkout:
subagentThreadsstarts empty;registerSubagentActivityonly registerskind === "started"; an unregisteredinteractedchild returns without registration. Its later nativeturn/startedis parked inpendingSubagentTurns, but nothing drains it because restoration never registers the existing child. Subsequent child items lack a turn context.I ran a focused A/B replay using the existing Codex adapter harness at
e27a03e94d43b504cfc3933282af913763312afd. Both variants use a fresh adapter and identical child turn/output/root-completion events. The only changed input is the first child activity kind:First activity Child updates Child reply saved by adapter startedpresent present interactedzero absent Both diagnostic assertions passed. This verifies the registration difference, not the proposed fix. Source inspection of current main
633438d54fstill shows this registration gap; I did not run the replay on that newer revision.There is already an exact matching fix in #22837. At head
81aa8032a6be9a1af033ffffbbef249e00456e3a,rememberSubagentTurnStartedrestores missing child context from saved identity, covering this path by source inspection. No patched-runtime verification or approval of that PR is claimed. GitHub currently reports merge conflicts, so opening another issue/PR for this incident would duplicate existing work.Prepared with GPT-6.1 Sol through the Codex harness in T3 Code. No private conversation contents or production data included.
I tried to reproduce this on the current build and could not.
Not run in the real app: it needs a live Codex provider, and the VM has no ChatGPT/Codex sign-in. On origin/main b68aedfdb7, added a CodexAdapterV2 replay test (branch factory/repro-15567, commit c01b200c76). Session 1 runs the existing resume transcript: subAgentActivity kind=started spawns a child, and the child's reply CODEX_FIRST_DONE is projected to its thread:subagent:* thread (this check passes). Session 2 is a fresh adapter harness standing in for a restarted server: the parent's turn emits subAgentActivity kind=interacted for the same native child, then the child emits turn/started, an agentMessage CODEX_AFTER_RESTART and turn/completed. On main no message.updated for the child thread with CODEX_AFTER_RESTART is emitted, and the test fails at that assertion.
vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts -t "existing child resumed on a fresh adapter session"gives 1 failed; format, lint and knip pass. The code path is unchanged from the reported commit: subagentThreads starts empty, registerSubagentActivity registers only kind=started, rememberSubagentTurnStarted parks unknown child turns in pendingSubagentTurns, and nothing drains them.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
juliusmarminge closed this
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Triage#
Thanks for matching the native events to the stored projections, @amozeo. That made this quick to confirm. It reproduces on current
main(1302ccacbd) and is the Codex counterpart of #13735, whose Claude fix doesn't touch this adapter. It isn't a duplicate of #15358, #5529, or #14630.What I found#
CodexAdapterV2keeps child registrations insubagentThreads, an in-memory map that starts empty for each provider session (around line 1668).resumeThreadcallsthread/resumewithexcludeTurns: trueand keeps onlythread.idandupdatedAt(decodeCodexResumeMetadata), so it never rebuilds existing children.turn/startedfrom an unregistered native thread gets parked inpendingSubagentTurns(rememberSubagentTurnStarted). That queue is flushed only byregisterSubagentThread, which runs for a newspawnAgentor asubAgentActivityof kindstarted. LatercollabAgentToolCallstatus updates and othersubAgentActivitykinds do nothing for unregistered children.turn/completedevents then fail inresolveItemEventContext/activeTurnsand return without projecting, so the stored subagent keeps its pre-restart status and messages. That matches your table. A child spawned after restart registers normally.CodexAdapterV2change sincef391794is #15389 (resume archived native sessions), which doesn't rebuild this map.Likely fix area#
registerSubagentThreaddoes.spawnAgentwould likely open a second Lineage row instead of reopening the old one, so the lookup would need to recover that original id.A maintainer will decide on the fix direction.