Skip to content

codex: subAgentActivity from a subagent's thread is projected as the root's task and edge #60

Closed

Description

@xxchan

Found while compacting docs/runtimes/codex.md and from a live peer probe on codex 0.158.0 (2026-10-02).

In codex collaboration V2 a subagent can message a sibling or the root (send_message("/root/beta"), send_message("/root")) and can spawn its own child. codex reports each of these as a subAgentActivity item on the sender's thread. Recorded on 0.158.0 (root thread R, alpha A, beta B, alpha's child gamma G):

  • on R: started /root/alpha (A), started /root/beta (B), completed A and B
  • on A: interacted /root/beta (A messaged its sibling B), started /root/alpha/gamma (G), completed G
  • on G: interacted /root (G messaged the root R)

Two projection problems follow:

  1. Task events. codexTaskViews (runtimes/codex/tasks.ts) turns every interacted into task_updated {taskId: agentThreadId, status: "running"} regardless of which thread reported it. G's interacted /root therefore creates a placeholder task whose id is the root thread itself (applyTaskEvent makes a placeholder for an unknown id), and A's interacted /root/beta reopens B as running even though send_message starts no turn. A task panel shows a phantom root task and wrong sibling status.
  2. Session edges. collabEdges (runtimes/codex/projection.ts) takes the parent as senderThreadId ?? state.rootThreadId; subAgentActivity carries no senderThreadId, so G's started on A's thread yields the edge R→G instead of A→G.

Suggested rule: a thread's subAgentActivity describes that thread's own children. The parent is the frame's thread; task updates and ends apply only to tasks that thread started; an interacted naming the root or a thread the sender did not start is peer messaging, recorded on the frame (as now) but not a task change.

Evidence: the raw recording of this probe (codex-peers.jsonl, 4 threads) can be turned into a replay fixture; the facts are also summarized in the subagent network artifact.

🤖 Generated with Claude Code

Activity

  1. added 2 commits that reference this issue on Oct 2, 2026
    409c55e
    07a9c94
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions