Skip to content

codex: a thread's subAgentActivity changes only its own children's tasks and edges - #65

Merged
xxchan merged 2 commits into
mainfrom
lookout/codex-subagent-activity
Oct 2, 2026
Merged

xxchan merged 2 commits into
mainfrom
lookout/codex-subagent-activity

Conversation

@xxchan

@xxchan xxchan commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Closes #60.

Problem

In codex collaboration V2 a thread reports subAgentActivity on its own thread, both for children it started and for messages it sends to peers. Recorded on 0.158.0 (root R starts alpha A and beta B; A messages B and starts gamma G; G messages R), the projection produced:

  • task_updated for the root thread from G's interacted /root, a phantom task that never ends;
  • task_updated running for B from A's interacted /root/beta, which reopens B although send_message starts no turn;
  • the edge R → G from G's started on A's thread, because the parent fell back to the root when the item has no senderThreadId.

Fix

The projection remembers which thread started each child (subagents, with each child's path). An item other than started is a task change or an edge only when it is about the reporting thread's own child. One naming the root, or a child another thread started, is peer messaging and stays on the frame only. A collaboration item's edge parent defaults to the reporting thread instead of the root.

A thread whose started is not in the stream (it started before a resume) is judged by its agentPath: the thread at its parent path decides (the root's path is /root, a child's comes from its started item); when that thread is unknown but the reporter's own path is known, it is someone else's child. Only when neither is known is it taken to be the reporter's, so its completed still reaches the task panel (review on the first version).

Code and tests only; docs/runtimes/codex.md is left for the docs compaction in progress. Not covered: peer messages carried by collabAgentToolCall with receiverThreadIds (older schema); no recording of that case.

Evidence

  • tests/replay/fixtures/codex-peers.raw.jsonl: the 0.158.0 probe recording (4 threads), scrubbed to lifecycle and collaboration items, thread ids renamed. The new replay test asserts the task events and edges; on main it receives the two extra task_updated events above.
  • Adversarial check: codex (via oar run codex) was given the claim and evidence and asked to find an input that now yields a wrong task event or edge; verdict NOT REFUTED.
  • A second test folds the after-resume case (no started items): alpha's interacted /root/beta changes nothing, alpha's completed /root/alpha/gamma ends gamma's task.
  • pnpm run check: 463 tests passed, sea trial mock 18/18.

🤖 Generated with Claude Code

exe.dev user and others added 2 commits October 2, 2026 11:11
…sks and edges

In codex collaboration V2 a thread reports `subAgentActivity` on its own
thread both for the children it started and for messages it sends to
peers. Recorded on 0.158.0 (root R starts alpha A and beta B, A messages B
and starts gamma G, G messages R):

- G's `interacted /root` became `task_updated` for the root thread, a
  phantom task, and A's `interacted /root/beta` reopened B as running;
- G's `started` on A's thread linked R → G, because the edge's parent fell
  back to the root when the item names no `senderThreadId`.

The projection now remembers which thread started each child. An item
other than `started` is a task change or an edge only when it is about the
reporting thread's own child; one naming the root, or a child another
thread started, is peer messaging and stays on the frame only. A child
whose start the stream does not hold (started before a resume) is taken
to be the reporter's, as before. The edge parent defaults to the reporting
thread.

The replay fixture `codex-peers.raw.jsonl` is that recording, scrubbed to
the lifecycle and collaboration items. Closes #60.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review on #65: when a thread's `started` item is not in the stream (it
started before a resume), its canonical `agentPath` still names its parent.
The projection now records each started child's path; the root's is
`/root`. For an item about a thread with no recorded start, the thread at
dirname(agentPath) decides; when that thread is unknown but the reporter's
own path is known, the child is someone else's. Only when neither is known
does the child count as the reporter's, as before.

So after a resume, alpha's `interacted /root/beta` is no longer read as a
task change for beta, while alpha's `completed /root/alpha/gamma` still
ends gamma's task.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@xxchan
xxchan merged commit f9555ca into main Oct 2, 2026
12 checks passed
@xxchan
xxchan deleted the lookout/codex-subagent-activity branch October 2, 2026 11:25
xxchan added a commit that referenced this pull request Oct 2, 2026
Updates docs/runtimes/codex.md for #65: a thread's subAgentActivity
changes only its own children's tasks and edges; peer messages (a
subagent messaging a sibling or the root) stay on the frame. Edge parent
is the reporting thread when the item names no sender. Closes #60.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: exe.dev user <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@xxchan xxchan mentioned this pull request Oct 2, 2026
xxchan added a commit that referenced this pull request Oct 2, 2026
Patch release:

- #65 codex: a thread's `subAgentActivity` changes only its own
children's tasks and edges. A subagent messaging a sibling or the root
no longer creates a phantom root task or reopens the sibling; a
grandchild's edge comes from its real parent (found by the daily
inspection, closes #60).
- #67 `--version` probe failures keep the native reason and stderr tail;
the codex test-home warmup waits for a successful handshake and exit.
- #68 codex: the first app-server initialization per `CODEX_HOME` is
coordinated within one OAR module. codex 0.160.0 fails SQLite
initialization when several processes first open a fresh home at once
(upstream openai/codex#50290); sessions, account usage and inventories
now wait for the first handshake, then start concurrently. Eight cold
concurrent opens went from 1/8 to 8/8.
- Docs: the 2026-10-02 maintenance pass (#62, #63, #64, #66).

Version bump only in this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: exe.dev user <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant