Skip to content

Codex subagents can be visible in terminal/proxy but absent from runtime subagent state #340

Open

Description

@Juliusolsson05

Problem

Codex subagents can be visible in the live terminal/proxy stream but absent from runtime.subAgents, leaving the feed with no semantic subagent UI.

Related: #178.

Evidence

Bundle:

~/.config/agent-code/debug-bundles/manual/2026-06-18T11-12-28-535-21c515e9

  • Note: "Not handling codex subagents at all."
  • state-snapshot.json has "subAgents": {}.
  • The screen text shows active Codex agents, including spawned/waiting agents.
  • proxy-events.jsonl contains Codex subagent headers including x-openai-subagent: collab_spawn, x-codex-parent-thread-id, and child x-codex-window-id.

Suspected Cause

Subagent tracking is transcript/rollout-entry driven. Codex tracking starts only for rollout-shaped JSONL entries and then correlates spawn_agent calls, outputs, and child rollout/session files.

If the live evidence is only proxy headers or screen text, current state tracking has no fallback path to create pending subagent state.

Relevant paths:

  • src/main/sessions/forwarder.ts
  • src/main/subagents/index.ts
  • src/main/subagents/codexSubagentState.ts

Expected

A Codex run with child windows but missing or delayed rollout correlation should still produce visible pending subagent rows, with diagnostics showing which correlation source was used: rollout output, notification, child session meta, proxy headers, or screen fallback.

Activity

  1. Juliusolsson05 commented on Jun 22, 2026

    @Juliusolsson05
    OwnerAuthor

    Linking this to #172 and #178 with an important boundary: the new rendering engine will not by itself fix missing Codex subagent source state. This issue still needs provider/runtime correlation to populate runtime.subAgents.

    Once that state exists, #172/#178 should decide how subagent items are owned and rendered in the parent feed without raw leakage, duplicates, or key collisions.

  2. Juliusolsson05 commented on Sep 27, 2026

    @Juliusolsson05
    OwnerAuthor

    Kept open, still very true (owner confirmed 2026-09-27). Triage finding: src/main/subagents/codexSubagentState.ts only recognizes the older spawn_agent + agent_type shape. Its own TODO notes that current Codex uses task_name, which the tracker ignores, so current Codex subagents probably get no subagent rows at all. The next step is to record a current Codex session that spawns a subagent, then re-scope to 'the task_name form has no parent→child session link'. The Claude equivalent is tracked separately (linked below).

  3. Juliusolsson05 commented on Sep 27, 2026

    @Juliusolsson05
    OwnerAuthor

    Claude companion issue: 1470.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-evidenceNeeds a recording/real use to settleprovider:codexAffects Codex integrationsev:P2Real bug with a workaroundtype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions