+ T3 Code · Plan 1 of 2 · 2026-07-20 · rev 3 (minimal transport) · companion: + UI mockups +
+Subagent Observability: Audit & Tech Spec
++ Expose Codex v2 subagents and Claude Code subagents + workflows in a live T3 panel: who + is running, what they're doing, token burn, elapsed time, and a drill-in. One generic + interface; both providers plug into it. +
+ +collabAgentToolCall spawn items —
+ that's v1; the v2 tracker is now keyed on subAgentActivity + child
+ thread/started metadata, and T3's child-thread suppression turns out not to
+ engage for v2 at all. (2) Codex agents are reusable identities, so the
+ snapshot now separates identity from activations and adds an idle state.
+ (3) Persistence is now material-transitions-only (1s ticks stay in
+ memory) because orchestration events are append-only and replay reads are global. Full
+ review notes: /tmp/subagent-audit/review/.+ Rev 3 — minimal transport. The bespoke stream event, subscriber gating, + projection table, migration, and capability flag are all deleted: the roster now ships as + one
agent.snapshot activity kind through the existing
+ append/persist/replay channel, latest-wins on the client — the exact pattern the
+ context-window meter already uses. Server delta shrinks to: contract types, two adapters,
+ one reducer in ingestion. Rev 2's bespoke design remains in this doc's git history as the
+ graduation path if fleets outgrow the activity channel.
+ 1 · Audit: Codex v2
++ Sources: codex-rs @ bb947e8e (2026-07-13); T3's generated schema pin 678157ac. Initial audit + corrected by adversarial review — v1/v2 item emission re-verified handler by handler. +
+ ++ The core fact: every v2 subagent is a full app-server thread. There are no + dedicated subagent RPCs — spawn/send/wait are model tools, not client methods. The + client observes subagents as ordinary threads plus parent-side thread items. +
+ +-
+
-
+ v1 vs v2.
features.multi_agent(v1, stable) vs +features.multi_agent_v2(under development, default off) — but the + model catalog forces v2 for gpt-5.6-sol and gpt-5.6-terra (models.json: multi_agent_version: "v2"), so on the models we care about it's on with zero config. v2 has no depth limit; + concurrency defaults to 4 (max_concurrent_threads_per_session). +
+ -
+ Identity & lineage arrive on the standard
+
thread/startednotification. TheThreadobject carries +parentThreadId, sharedsessionId, +agentNickname(random, e.g. "Marlow"),agentRole(agent_type: + explorer/awaiter/custom), and +source.subAgent.threadSpawn.{depth, agentPath}with hierarchical paths like +/root/researcher. + Clients are auto-subscribed to child-thread events — no subscribe call needed. +
+ -
+ Parent-side items — v1 and v2 emit differently (this is where the first
+ draft was wrong):
+
-
+
-
+ v1 emits rich
collabAgentToolCallitems for + spawn/send/resume/close/wait, carryingreceiverThreadIds, +prompt,model,reasoningEffort, and +agentsStates(child thread id →{status, message}). +
+ -
+ v2 emits
+
subAgentActivity {kind: started|interacted|interrupted, agentThreadId, + agentPath}+ on spawn/message/interrupt (multi_agents_v2/spawn.rs:142emits + only this — verified, noCollabAgentToolCallanywhere in the v2 + spawn path). The only v2collabAgentToolCallemitter is +wait, and it ships with empty +receiverThreadIds/ +agentsStates(multi_agents_v2/wait.rs:85,90). + Model/prompt/agentsStates are not on v2 parent items. +
+
thread/status/changed, +turn/started|completed,thread/settings/updated), not from + parent items. +
+ -
+ v1 emits rich
-
+ Per-agent token burn is free:
+
thread/tokenUsage/updated {threadId, turnId, tokenUsage: {total, last, + modelContextWindow}}+ fires per child thread with input/cached/output/reasoning breakdowns. No server-side tree + rollup — client sums. +
+ -
+ Agents are reusable identities, not one-shot tasks.
+
send_message/followup_taskre-target an existing child thread + and trigger new turns on it (interaction events atevent_mapping.rs:133-178). + A childturn/completedmeans "this run finished", not "this agent is done" — + the agent sits idle and resumable. +
+ -
+ Reference consumer: the Codex TUI builds its
/agentUI from + notifications alone — it caches child threads from +subAgentActivity/thread/started, buffers the last ~6 item + summaries per child, labels agents "{nickname} [{role}]". +
+ -
+ Not exposed: the live
AgentRegistry(model-facing +list_agentsonly), tree token rollups, per-agent "current activity" endpoint. +thread/list?parentThreadId/ancestorThreadIdsubtree filters are + experimental-gated and newer than T3's schema pin. +
+
effect-codex-app-server pin
+ already has everything needed — subAgentActivity,
+ collabAgentToolCall,
+ Thread.parentThreadId/agentNickname/agentRole +
+ source.subAgent.threadSpawn, thread/tokenUsage/updated. No
+ regeneration required to ship.
+ CodexSessionRuntime.rememberCollabReceiverTurns learns child threads only from
+ collabAgentToolCall.receiverThreadIds; under v2 those are empty, so the
+ collabReceiverTurns map never populates and the suppression list is inert. What
+ v2 child-thread notifications actually do to the parent timeline today (leak in? get dropped
+ elsewhere?) must be established with a live v2 wire probe — this is the
+ entry gate for the Codex slice (§8). The suppression narrative in the first draft applied
+ only to v1 models (e.g. gpt-5.6-luna).
+ 2 · Audit: Claude Agent SDK
+
+ Sources: @anthropic-ai/claude-agent-sdk 0.3.170 type declarations, CLI 2.1.214 binary, and a
+ live stream-json wire probe (real subagent spawn captured). All SDK-type claims
+ below re-verified by both reviewers.
+
+ The core fact: a complete task lifecycle already streams over stdio, keyed
+ by task_id + tool_use_id, covering subagents, background shells,
+ monitors, and workflows uniformly:
+
task_started {task_id, tool_use_id, description, subagent_type?, task_type?, workflow_name?, prompt?}
+task_progress {task_id, description, usage:{total_tokens, tool_uses, duration_ms}, last_tool_name?, summary?}
+task_updated {task_id, patch:{status: pending|running|completed|failed|killed|paused, end_time?, is_backgrounded?, error?}}
+task_notification {task_id, status: completed|failed|stopped, summary, usage?, output_file}
+
+ -
+
-
+ Subagent messages arrive on the main stream tagged
+
parent_tool_use_id+subagent_type+ +task_description. By default only tool_use/tool_result blocks are forwarded; +forwardSubagentText: trueforwards the full nested transcript. +
+ -
+ "What it's doing right now":
last_tool_nameon every + progress tick andtool_progressheartbeats (tool_name, elapsed_time_seconds, parent_tool_use_id, task_id) are free.agentProgressSummaries: trueadditionally forks each running + subagent every ~30s for an AI-written present-tense summary in +task_progress.summary— real recurring model calls (SDK default is + off), so this is a per-instance setting, not a default (§8). +
+ -
+ Workflows:
task_startedcarries +task_type:'local_workflow'+workflow_name; +task_progresscarries an undeclared-but-real +workflow_progressarray (wire-probe confirmed) with +workflow_phase {index, title}and +workflow_agent {label, phaseIndex, phaseTitle, agentId, model, state, startedAt, + attempt, lastToolName, promptPreview, resultPreview, tokens, toolCalls, error}+ entries. Not insdk.d.ts; consume defensively behind a schema guard. + Per-agent full results are files-only (journal.jsonl, +agent-<id>.jsonl). +
+ -
+ Usage granularity: per task (
total_tokensonly, no USD), per + message (if forwarded), per model + costUSD on the turnresult.modelUsage, + session-wide via an explicitly-unstable control request. +
+ -
+ Rosters: the typed
background_taskscontrol request returns + the live task list (BackgroundTaskSummary[]) — this is the stable + roster/reconciliation source. Abackground_tasks_changedstream event was + also observed on the wire but is undeclared and its literal doesn't appear in the CLI + binary strings — treat as bonus signal only, never a dependency. +
+ -
+ Gaps needing upstream: no model field on task events, no start_time on
+
task_started(use receive time), no per-subagent USD, +workflow_progressuntyped. +
+
task.started/progress/completed runtime events exist and are persisted, but
+ subagent_type, tool_use_id, workflow_name,
+ prompt, output_file are dropped; task_updated falls
+ into the unknown-subtype warning path (status transitions lost);
+ parent_tool_use_id traffic is filtered out of usage accounting. Raw payloads
+ survive in raw.payload on the ephemeral runtime events (NDJSON logs) —
+ recoverable at the adapter, but not from the durable store, so pre-feature
+ history cannot be backfilled (§5.5).
+ 3 · Audit: T3's existing pipeline
+ +-
+
-
+ The right abstractions already exist.
+
ProviderRuntimeEventV2already has +task.started/progress/completed(Claude emits them today, persisted and + streamed to clients asthread.activity-appended), a +collab_agent_tool_callcanonical item type, and typed +ThreadTokenUsageSnapshot. +
+ -
+ Snapshot+delta is a solved pattern:
subscribeShell/subscribeThread+ do live-buffer-first attach, snapshot-or-replay withafterSequence, + sequence-deduped deltas.projection_thread_sessionsis the precedent for an + upserted per-thread mutable row. +
+ -
+ Two cost facts that constrain the design (surfaced in review):
+
-
+
- + Every accepted orchestration command appends an immutable event before + updating any projection — "upsert" describes the projection, not the event store. + High-frequency dispatches are permanent rows. + +
-
+
subscribeThread'safterSequencecatch-up reads the + global event range after the cursor and filters per-thread afterward + (ws.ts:1385-1395), and shell resume falls back to full snapshots beyond +SHELL_RESUME_MAX_GAP = 1000. Fleet-wide event volume taxes every + reconnect. +
+
+ -
+ Compat asymmetry that shaped the transport:
+
OrchestrationEventis a closedSchema.Uniondecoded by the RPC + client — a new event type breaks old clients (fails decode) and would need + per-subscriber gating. ButOrchestrationThreadActivity.kindis an open string + withpayload: Schema.Unknown— a new activity kind flows through + every layer untouched. That's why §5.3 ships the roster as an activity kind, not an event + type. +
+ -
+ Gaps: only Claude emits
task.*(Codex/OpenCode emit only + item lifecycles; ACP nothing). Task payloads lack name/model/parent-linkage and +usageis untyped. Tool activities carry no owning-agent id. Turn cost never + reaches the client. +
+ -
+ Client: the right panel (
rightPanelStoresurfaces: + plan/diff/files/file/preview/terminal) is the natural mount;PlanSidebaris + the structural template;WorkingTimer(DOM-write ticking, no React commits), +Badgevariants,animate-status-pulse, and +SimpleWorkEntryRoware the primitives to reuse. Mobile shares state via +client-runtimebut duplicates presentation — put new derivation helpers in +client-runtime. +
+
4 · Unified data-availability matrix
++ "Wire" = the provider protocol T3 already speaks. "T3 today" = what actually reaches the + browser now. +
+ +| Datum | +Codex v2 wire | +Claude wire | +T3 today | +Plan | +
|---|---|---|---|---|
| Agent id | +yes child thread id (UUIDv7) | +yes task_id + tool_use_id |
+ taskId only (Claude) | +normalize to agentId + keep provider |
+
| Name / label | +
+ yes nickname + role + path (child
+ thread/started)
+ |
+ yes description, subagent_type, name, workflow label | +description only | +name + agentType |
+
| Model | ++ partial child thread settings — not on v2 + parent items + | ++ partial workflow agents yes; plain subagents only if + text forwarded + | +— | +optional model |
+
| Status / lifecycle | ++ yes child thread/status + turn events (idle ≠ terminal) + | +yes task_updated + task_notification | +started/completed only; task_updated dropped |
+ 7-state enum incl. idle |
+
| Current activity | +yes child item stream | +yes last_tool_name; AI summaries opt-in | +lastToolName forwarded but not surfaced per-agent | +currentActivity + recent feed |
+
| Token burn | +yes per-thread breakdowns | +yes total_tokens per task | +untyped blob | +typed usage |
+
| Start / end time | +yes thread/turn timestamps | +partial end_time yes; start = receive time | +activity createdAt | +firstStartedAt/lastActivityAt/endedAt |
+
| Parent linkage | +yes parentThreadId + depth + path | +partial tool_use_id, 1 level on stream | +— | +parentAgentId |
+
| Workflow phases / retries | +n/a (paths encode tree) | +
+ partial undeclared
+ workflow_progress (incl. attempt)
+ |
+ — | +workflow agents = child agents with phaseTitle, attempt |
+
| Cost USD | +no | +partial per-model per-turn only | +— | +out of scope v1 | +
5 · Design: the generic interface
+ +
+ Principle: don't invent a new pipeline — enrich the one that exists. The
+ task.* runtime-event family is already the provider-agnostic "unit of delegated
+ work". We (a) extend its payloads with the missing typed fields, (b) make the Codex adapter
+ synthesize the same events from v2 notifications, and (c) have ingestion fold them into one
+ upserted snapshot per agent that rides the existing subscribeThread stream —
+ with persistence limited to material transitions.
+
5.1 Contract: identity + activations new
++ Review-driven shape change: a Codex agent is a durable, re-activatable identity while a + Claude task is a one-shot execution. The snapshot models the identity with rollups + of its activations, so a follow-up doesn't destroy history and elapsed time stays + meaningful. +
+// packages/contracts/src/orchestration.ts (additive)
+ThreadAgentStatus = "pending" | "running" | "waiting" | "idle" | "completed" | "failed" | "stopped"
+ // waiting = blocked on approval/user-input, or queued (workflow)
+ // idle = finished a run but resumable (Codex send_message/followup; Claude paused)
+ // completed/failed/stopped = terminal
+
+ThreadAgentUsage = {
+ totalTokens: NonNegativeInt,
+ inputTokens?, cachedInputTokens?, outputTokens?, reasoningOutputTokens?,
+ toolUses?: NonNegativeInt,
+}
+
+ThreadAgentSnapshot = {
+ agentId: TrimmedNonEmptyString, // stable identity: Claude task_id · Codex child thread id
+ provider: ProviderDriverKind, // id-space discriminator; prevents cross-provider collisions
+ kind: "subagent" | "workflow" | "workflow_agent" | "shell" | "monitor" | "other",
+ name: TrimmedNonEmptyString, // description · nickname · workflow label
+ agentType?: TrimmedNonEmptyString, // subagent_type · agent_role
+ model?: TrimmedNonEmptyString,
+ status: ThreadAgentStatus,
+ currentActivity?: TrimmedNonEmptyString,
+ lastToolName?: TrimmedNonEmptyString,
+ usage?: ThreadAgentUsage, // cumulative across activations
+ firstStartedAt: IsoDateTime,
+ lastActivityAt: IsoDateTime,
+ endedAt?: IsoDateTime, // cleared on re-activation
+ activationCount: NonNegativeInt, // Codex follow-ups · workflow retry attempts
+ spawnTurnId?: TurnId, // turn that created it
+ lastTurnId?: TurnId, // latest turn that touched it (UI groups by this)
+ parentAgentId?: TrimmedNonEmptyString,
+ phaseIndex?: NonNegativeInt, // workflow phase membership (index is authoritative;
+ phaseTitle?: TrimmedNonEmptyString, // title is display — titles can repeat across phases)
+ // kind === "workflow" only:
+ phases?: Array<{ index: NonNegativeInt, title: TrimmedNonEmptyString }>, // ordered phase list
+ scriptPath?: TrimmedNonEmptyString, // persisted workflow script (WorkflowOutput.scriptPath)
+ runId?: TrimmedNonEmptyString, // workflow run id (resume handle)
+ approvalRequestId?: ApprovalRequestId, // set while waiting on an approval → UI deep-link
+ outputFile?: TrimmedNonEmptyString, // Claude transcript path — phase-2 drill-in needs it
+ resultSummary?: TrimmedNonEmptyString,
+ errorMessage?: TrimmedNonEmptyString,
+ recentActivity: Array<{ at: IsoDateTime, summary: string }>, // ring buffer, max 6
+ updatedAt: IsoDateTime, // staleness + "while you were away" watermark
+}
+
+ 5.2 Provider mapping
+Claude → snapshot
+| SDK message | +Effect | +
|---|---|
task_started |
+ + upsert: id, name=description, kind from task_type, agentType=subagent_type, + firstStartedAt=now, status=running, outputFile later + | +
task_progress |
+
+ usage, lastToolName, currentActivity=summary;
+ workflow_progress[] (schema-guarded):
+ workflow_phase entries → the workflow snapshot's ordered
+ phases list; workflow_agent entries → upsert child
+ workflow_agent snapshots (label, phaseIndex+phaseTitle, model, state,
+ tokens, attempt)
+ |
+
Workflow tool_result (WorkflowOutput) |
+
+ scriptPath + runId onto the workflow snapshot (typed on
+ the tool output: "Path to the persisted workflow script for this invocation")
+ |
+
task_updated |
+ status patch (killed→stopped, paused→idle), endedAt=end_time, errorMessage | +
task_notification |
+ terminal status, resultSummary, final usage, outputFile | +
tool_progress (has task_id) |
+ lastToolName + recentActivity entry | +
can_use_tool / approval (has agent_id) |
+ status=waiting + approvalRequestId; cleared on resolution | +
+ Adapter fixes: stop dropping
+ subagent_type/tool_use_id/workflow_name/output_file; handle
+ task_updated (today: warning path). Roster reconciliation via the typed
+ background_tasks control request (not the undeclared stream event).
+ agentProgressSummaries is a per-instance setting, default off — fallback
+ currentActivity is last_tool_name. Not enabling
+ forwardSubagentText in v1.
+
Codex v2 → snapshot (corrected)
+| Notification | +Effect | +
|---|---|
child thread/started (source = subAgent.threadSpawn) |
+ + upsert identity: id=thread id, name=nickname, agentType=agentRole, parentAgentId, + depth/path, firstStartedAt + | +
subAgentActivity item (parent stream) |
+ + started → running; interacted → running + activationCount++; interrupted → stopped + | +
child turn/started |
+ status=running (clear endedAt/resultSummary on re-activation) | +
child turn/completed |
+ + status=idle (resumable — not terminal), resultSummary=last + message + | +
child thread/status/changed |
+ active flags waitingOnApproval/UserInput → waiting; closed → stopped | +
child thread/tokenUsage/updated |
+ usage (full breakdown) | +
child item/started|completed |
+ currentActivity + recentActivity (reuse item titles) | +
child thread/settings/updated |
+ model (v2 parent items don't carry it) | +
+ collabAgentToolCall is not used for tracking (v2 emits it only for
+ wait, with empty receivers) — render it as a parent activity only. Runtime
+ change: CodexSessionRuntime learns children from
+ thread/started.source + subAgentActivity, routes their
+ notifications to the agent tracker, and filters them out of the parent timeline.
+ Entry gate: a live v2 wire probe to establish what child chatter
+ reaches T3 today (§8).
+
+ 5.3 Transport: one activity kind, zero new machinery rev 3 +
+
+ The dumb store already exists — use it.
+ OrchestrationThreadActivity has a free-form kind and an open
+ payload: Schema.Unknown, is persisted/capped/replayed, and streams over
+ subscribeThread today. And T3 already ships latest-wins state through it:
+ context-window.updated activities carry a full usage snapshot and the client
+ just takes the newest one (deriveLatestContextWindowSnapshot). Agents work
+ identically:
+
// Ingestion keeps the per-thread agent map in memory (it must merge events anyway).
+// On a MATERIAL change — status transition · name/model/phase discovery ·
+// currentActivity change · usage crossing a 25k step · terminal fields —
+// it appends ONE activity via the EXISTING thread.activity.append command:
+{ kind: "agent.snapshot",
+ tone: "info",
+ summary: "2 agents running", // human-readable on purpose (see compat)
+ payload: { agents: ThreadAgentSnapshot[] } } // full roster, latest-wins
+
+// Client: scan thread.activities for the newest agent.snapshot → that IS the panel state.
+// Same derivation pattern as the context-window meter. Typed decode of the payload
+// happens client-side against the contracts schema; a failed decode = ignore the row.
+ What this deletes relative to the rev-2 design — with no loss of insight:
+| Rev 2 (bespoke transport) | +Rev 3 (activity channel) | +
|---|---|
+ New thread.agent.upsert command + thread.agent-upserted event
+ in the closed union
+ |
+ Reuses thread.activity.append — no new command or event types |
+
+ Subscriber opt-in gating + acceptAgentEvents + old/new contract tests
+ (closed-union decode risk)
+ |
+
+ Not needed: kind is an open string, payload is
+ Unknown — old clients decode fine and render a rare benign "2 agents
+ running" info row (arguably a feature)
+ |
+
+ projection_thread_agents table + migration + snapshot-assembly changes +
+ shell-refetch exclusion
+ |
+ + Not needed: rows land in the existing activities projection; the 500-row cap is the + retention policy + | +
ServerConfig.threadAgents capability flag |
+
+ Not needed: presence of an agent.snapshot activity is self-describing
+ |
+
| Reducer hydration from the new projection | +
+ Same trick ingestion already uses for task titles: on first event for a thread, read the
+ latest agent.snapshot from the loaded thread detail (findTaskTitleInActivities
+ precedent)
+ |
+
-
+
-
+ Volume: full-roster payload (≤ ~10 agents, a few KB) × material
+ transitions only ≈ tens of rows per agent run — same order as the
+
task.progressrows Claude already writes today. 1s ticks and elapsed time + stay client-derived, never persisted. +
+ -
+ Codex-synthesized
task.*events still bypass +runtimeEventToActivities+ (the marker survives from rev 2) — they feed the reducer only, so slice 2 adds no timeline + spam. New clients add one skip line foragent.snapshotin +deriveWorkLogEntries(precedent:context-window.updatedis + skipped the same way). +
+ -
+ Known trade-offs, accepted: (a) the payload is untyped on the wire — the
+ schema lives in contracts and the client decodes tolerantly; (b) latest-wins inside a
+ 500-cap window means a thread with 500+ later activities loses its old roster — at that
+ distance the agents are ancient history, and the timeline's
task.*rows + remain; (c) full-roster-per-write is O(agents) redundant — at ≤10 agents this is noise, + and it's what makes latest-wins (and therefore everything else) simple. +
+ - + Escape hatch: if per-agent typed wire events or bigger fleets ever + matter, the rev-2 design (dedicated event + projection + subscriber gating, preserved in + git history of this doc) is the graduation path. Don't build it until the counter metric + (§8) says so. + +
5.3b What happens to child-thread events — dropped today, distilled tomorrow
+
+ Today, T3 durably stores none of it. Precisely: Codex v1 child-thread
+ notifications are suppressed at the session runtime (their item events are re-attributed to
+ the parent turn; thread/turn/usage events dropped); Codex v2 child chatter is unaudited (the
+ suppression doesn't fire — probe gate in §8); Claude subagent traffic is reduced to the
+ task.* activity rows and its parent_tool_use_id stream deltas are
+ filtered out. The only place raw child events land is the rotating NDJSON observability logs
+ — not queryable, not replayed.
+
This plan changes that to "distilled, not mirrored":
+-
+
-
+ Durably stored (new): the per-agent snapshot — identity, lifecycle, usage
+ rollups,
recentActivity(last 6 summaries), result summary, script/output + pointers — asagent.snapshotactivity rows in the existing activities + projection + event store. This is what survives restarts and reconnects. +
+ -
+ Still not stored: full child transcripts (every tool call, message delta,
+ reasoning block). Deliberately — mirroring child streams into the orchestration store
+ would multiply event volume by fleet size (§3's replay-cost facts). The providers already
+ persist them (Codex rollout files readable via
thread/read; Claude +agent-<id>.jsonl/output_file), so the phase-2 drill-in + RPC reads them on demand from provider storage instead of duplicating them. +
+ -
+ Caveat that falls out: transcript drill-in is only as durable as provider
+ storage — e.g. an ephemeral Codex thread or a cleaned
/tmpoutput file means + the snapshot survives but the deep transcript doesn't. Acceptable: the snapshot is the + record; the transcript is an inspection tool. +
+
5.4 Recovery & staleness new (review-driven)
+-
+
-
+ Reducer bootstrap: on the first event for a thread, hydrate the in-memory
+ agent map from the latest persisted
agent.snapshotactivity (same pattern + ingestion already uses to recover task titles from activities), so a mid-run server + restart doesn't orphan records when the nexttask_progressarrives without + itstask_started. +
+ -
+ Orphan sweep: provider sessions are child processes of the T3 server — on
+
session.exited(or a newsession.startedfor the thread), all + non-terminal agents for that thread transition tostoppedwith +endedAt=nowand an "orphaned on session exit" errorMessage. Reconciliation on + resume: Claude via thebackground_taskscontrol request; Codex via tracked + child threads. +
+ -
+ Client staleness:
updatedAt+ the client's sync watermark + distinguish "running" from "stale while disconnected"; the UI's transport states + (loading/synchronizing/live/reconnecting) come from the existing subscription status + machinery, not the snapshot. +
+ - + History: pre-feature threads cannot be backfilled — dropped fields only + exist in ephemeral NDJSON logs. Documented as a non-goal. + +
5.5 Drill-in
+-
+
-
+ Phase 1 (ships with the panel):
recentActivityring buffer + +resultSummary+ prompt preview. Workflow cards get a "View script" + affordance:scriptPathopens in the right panel's existing +file:surface (read-only file preview — zero new viewer code; the path is + outside the workspace root, so the file surface needs to accept absolute session paths or + the server proxies the read). +
+ -
+ Phase 2 (full transcript): one read RPC
+
orchestration.getAgentTranscript {threadId, agentId}. Codex: +thread/readon the child thread. Claude: tailoutputFile/ +agent-<id>.jsonlserver-side (the snapshot's +outputFilefield exists for exactly this), rendered with the existing + work-log row components. Avoids turning onforwardSubagentTextglobally. +
+
6 · Server changes (all additive)
++ Rev 3: no new command, event type, projection table, migration, subscription input, or + capability flag. The entire delta is contracts (types only), two adapters, and one reducer + inside ingestion. +
+| # | +Where | +Change | +Size | +
|---|---|---|---|
| 1 | +packages/contracts |
+
+ ThreadAgentSnapshot + status/usage schemas and the
+ agent.snapshot payload schema (used for client-side decode — no
+ wire-protocol change); extend TaskStarted/Progress/Completed payloads
+ (optional
+ name/agentType/model/toolUseId/parentTaskId/workflowName/phaseIndex/phaseTitle/phases/attempt/scriptPath/runId/outputFile
+ + typed usage + timeline-bypass marker)
+ |
+ S | +
| 2 | +ClaudeAdapter |
+
+ Carry the dropped fields; handle task_updated; approval → agent attribution
+ via agent_id; workflow_progress schema-guarded parse into
+ child task.* events; background_tasks reconciliation;
+ agentProgressSummaries per-instance option (default off)
+ |
+ M | +
| 3 | +CodexSessionRuntime / CodexAdapter |
+
+ Gated on live v2 probe. Track children from
+ thread/started.source.subAgent + subAgentActivity; route child
+ notifications to synthesized timeline-bypassing task.* events per §5.2;
+ keep child chatter out of the parent timeline (new filtering — the existing suppression
+ doesn't fire for v2)
+ |
+ M–L | +
| 4 | +ProviderRuntimeIngestion |
+
+ Agent reducer (in-memory, hydrated from the latest persisted
+ agent.snapshot) → material-transition agent.snapshot activity
+ appends through the existing command; orphan sweep on session exit; dispatch-rate
+ counter metric
+ |
+ M | +
+ Non-goals v1: cost USD attribution, ACP (Cursor/Grok) support (no wire signal exists),
+ cross-thread agent trees, controlling agents (stop/steer — Codex exposes interruption only
+ as a model tool today), history backfill. OpenCode: falls out automatically if its adapter
+ ever emits task.*.
+
7 · Client changes
+-
+
-
+ Derivation in
client-runtime(shared with mobile): +deriveLatestAgentSnapshot(activities)— newest +agent.snapshotrow, tolerant payload decode (mirrors +deriveLatestContextWindowSnapshot) — plus +deriveAgentPanelState(agents, syncStatus)— group by workflow, split + running/settled (bylastTurnId), compute totals, staleness from +updatedAt+ subscription state. +
+ -
+ Web: add
"agents"to +RIGHT_PANEL_KINDS(singleton surface, storage v7→8); tab + "+" add-menu entry + inRightPanelTabs(surface always addable from the menu; the tab auto-appears + once the thread has agents); anAgentsPanelbranch inChatView's + surface switch; a compact live strip near the "Working…" row; one skip line for +agent.snapshotinderiveWorkLogEntries. Reuse: +Badge,animate-status-pulse,WorkingTimer, +SimpleWorkEntryRow. +
+ - + Mobile: inspector-pane tenant on tablet, sheet on phone — later slice, + shares the derivation helpers. + +
- + Visual design + feature-to-field milestones: see the + companion UI plan. + +
8 · Phasing, risks, open questions
+Phasing
+-
+
- + Slice 1 — contracts + Claude: #1, #2, #4, #5 → panel shows Claude + subagents + workflows end-to-end. + +
- + Slice 2 — Codex: entry gate: live v2 wire probe (spawn agents on + gpt-5.6-sol through T3's app-server wrapper, capture exactly which child notifications + arrive and what leaks into the timeline today). Then #3 → same panel lights up for Codex + with zero client work. + +
- Slice 3 — drill-in transcripts + mobile. +
Risks
+-
+
-
+
workflow_progressis undeclared in the SDK types — schema-guarded parsing; + file upstream for typing. Thebackground_tasks_changedstream event is + probe-only evidence — never a dependency (typed control request is the roster source). +
+ - + Codex child-thread routing touches turn-attribution logic — needs tests that parent + transcript behavior is unchanged for both v1 and v2 models. + +
- + Event volume: material-transition persistence bounds it, but slice 1 ships with a counter + metric on agent-upsert dispatch rate so we see reality before slice 2 multiplies it. + +
-
+ Compat: one test that an old client's activity handling renders (or benignly ignores) an
+
agent.snapshotrow — the open-string channel makes this low-risk, but verify + rather than assume. +
+
Open questions
+-
+
- Settled-agent grouping: collapse by turn (current lean) or by workflow run? +
- + Auto-open the panel on first agent spawn? (Lean: badge on the tab + the inline strip, no + auto-open.) + +
-
+
agentProgressSummaries: per-instance setting shipped off — do we want a UI + toggle in thread settings, or instance config only? +
+