Skip to content

feat(composer): running-subagent strip with per-agent filtering#59

Merged
Legacynnn merged 1 commit into
mainfrom
Legacynnn/composer-subagent-chat-ui
Jun 24, 2026
Merged

feat(composer): running-subagent strip with per-agent filtering#59
Legacynnn merged 1 commit into
mainfrom
Legacynnn/composer-subagent-chat-ui

Conversation

@Legacynnn

Copy link
Copy Markdown
Owner

Summary

Adds a slim strip above the composer that lists a session's currently-running spawned subagents and lets you focus the conversation on one.

  • While subagents are running (Claude Task/Agent or Codex subagent_*), the strip slides in flush on top of the composer with one chip per live subagent — each with a deterministic pixel-art sprite, identity color, and name — and slides out when they finish.
  • Running detection keys off the tool call's result (mirroring AgentChildrenBlock's isRunning), so chips persist for the subagent's whole lifetime instead of vanishing when input streaming ends.
  • Clicking a chip filters the thread to just that subagent's output. A banner at the top of the thread names the subagent and shows derived activity — type, tool uses, files touched, steps, and running/done — with a "Show all" control. The banner persists after the subagent finishes so the filter stays clearable.

Implementation

  • src/features/composer/subagent-strip/extract-subagents.ts (single source of truth: extractRunningSubagents, selectSubagentBlock, summarizeSubagent), use-running-subagents.ts, pixel-avatar.tsx, index.tsx.
  • src/features/conversation/state/subagent-filter-store.ts — Zustand store keyed by sessionId.
  • src/features/panel/subagent-filter-banner.tsx + filtering wired into thread-viewport.tsx (transforms the source messages array so virtualization stays correct).
  • Exported readAgentsStates / AgentState from subagent-tool.tsx for reuse.

Notes

  • Per-token usage is not surfaced — it isn't carried on any rendered part (ToolCallPart, Task results, or Codex agentsStates), so the banner shows the activity it can count. Real token counts would need backend plumbing.

Test plan

  • tsc --noEmit clean, biome check clean
  • Unit tests for extract-subagents (running detection incl. the streamingStatus: done regression, Codex dedupe, selectSubagentBlock, summarizeSubagent) and a render test for the strip (collapse + chip toggle)
  • Manual: spawn parallel Claude Task subagents — confirm the strip slides in/out, chips persist while running, click-to-filter + banner stats, "Show all" restores the thread
  • Manual: repeat with a Codex subagent_spawn session

Adds a strip above the composer listing currently-running spawned
subagents (Claude Task/Agent + Codex subagent_*), each with a
deterministic pixel-art sprite and identity color. Clicking a chip
filters the thread to that subagent's output, with a banner showing
its type and activity stats (tool uses, files, steps, running/done).
@Legacynnn Legacynnn merged commit 2017195 into main Jun 24, 2026
12 of 13 checks passed
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.

1 participant