Skip to content

multi-agent: add path-based v2 activity tracking - #27007

Merged
jif-oai merged 5 commits into
mainfrom
jif/new-tui-mav2
Jun 9, 2026
Merged

multi-agent: add path-based v2 activity tracking#27007
jif-oai merged 5 commits into
mainfrom
jif/new-tui-mav2

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Why

Multi-agent v2 identifies agents by canonical paths, but its tool handlers still emitted the larger legacy collaboration begin/end events built around nickname and role metadata. App-server, rollout-trace, analytics, and TUI consumers therefore lacked one compact path-based completion signal that behaved consistently across live events and replay.

The TUI also needs a bounded /agent status surface for v2 agents. It should use recent local activity for previews, refresh liveness without loading full histories, and keep the legacy picker available when no path-backed v2 agent is known.

What changed

  • Replace the v2 spawn_agent, send_message, followup_task, and interrupt_agent legacy lifecycle emissions with a success-only SubAgentActivity event. The event records the tool call ID, occurrence time, affected thread, canonical agent path, and started, interacted, or interrupted kind.
  • Expose the activity as a completion-only app-server v2 subAgentActivity thread item in live notifications and reconstructed history, regenerate the protocol schemas, and count it in sub-agent tool analytics.
  • Track canonical paths from live activity and loaded-thread metadata in the TUI, and render the activity in live and replayed transcripts.
  • Make /agent list running path-backed agents with summaries from bounded local event buffers. Each summary is capped at 240 graphemes, the scan is capped at six recent items, only the last three wrapped lines are shown, and command output is omitted. Liveness falls back to metadata-only thread/read when local turn state is unavailable.
  • Persist the activity as a terminal rollout-trace runtime payload and reduce it to the corresponding spawn, send, follow-up, or close interaction edge. interrupt_agent is classified as a close-edge operation.
  • Preserve the legacy picker when no path-backed v2 agent is known.

Compatibility

App-server v2 clients that consumed collabAgentToolCall begin/end pairs for these tools must handle the new completion-only subAgentActivity item. Legacy v1 collaboration behavior is unchanged.

Screenshot

Screenshot 2026-06-08 at 15 40 47

Testing

  • just test -p codex-app-server-protocol
  • just test -p codex-rollout-trace
  • Added focused coverage for activity analytics, terminal trace serialization, spawn-edge reduction, interrupt_agent classification, TUI status rendering without aggregated command output, and clearing stale running state after a completed turn.

@jif-oai
jif-oai requested a review from a team as a code owner June 8, 2026 14:45
@jif-oai jif-oai changed the title feat: new tui mav2 tui: add multi-agent v2 activity tracking Jun 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6bba7d7f04

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/app/session_lifecycle.rs
Comment thread codex-rs/rollout-trace/src/reducer/tool/agents.rs Outdated
Comment thread codex-rs/app-server-protocol/src/protocol/v2/item.rs
Comment thread codex-rs/analytics/src/reducer.rs Outdated
Comment thread codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs
@jif-oai jif-oai changed the title tui: add multi-agent v2 activity tracking multi-agent: add path-based v2 activity tracking Jun 8, 2026
@btraut-openai

Copy link
Copy Markdown
Contributor

Are we at a greater risk of contention with agent names now? We currently refer to subagents via their uuid, but uniqueness of subagent path is now on the model to ensure.

@fcoury-oai fcoury-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke tested the new behavior and it worked as expected. Codex found 3 issues that seem real, please take a look and check if they are worth addressing.

Approved.

Comment thread codex-rs/tui/src/app/agent_status_feed.rs Outdated
Comment thread codex-rs/tui/src/app/session_lifecycle.rs Outdated
Comment thread codex-rs/rollout-trace/src/reducer/tool/agents.rs Outdated
@jif-oai

jif-oai commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Are we at a greater risk of contention with agent names now? We currently refer to subagents via their uuid, but uniqueness of subagent path is now on the model to ensure.

@btraut-openai no this is already covered in core

@jif-oai
jif-oai merged commit fae2709 into main Jun 9, 2026
31 checks passed
@jif-oai
jif-oai deleted the jif/new-tui-mav2 branch June 9, 2026 10:14
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants