Skip to content

Show Agent-tool subagents in the Agents panel - #23

Merged
currentbits merged 1 commit into
mainfrom
coder/research-agents-background-subagents-not-0c68c3
Aug 14, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/research-agents-background-subagents-not-0c68c3

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Fixes #21.

Problem

The Agents panel only lists threads Solenta itself creates in its store. Subagents spawned inside a Claude Code session via the Agent tool live entirely in the CLI process — the panel never saw them.

Approach

The CLI's stream is the only trace of a subagent, so the runner tracks their lifecycle there and stores rows on the thread record (thread.subagents, keyed by tool_use id, capped to the newest 20):

  • A tool_use named Agent (or Task in older CLIs) registers a row as running, with the call's description and subagent_type.
  • A sync agent's tool_result settles it done (or failed on is_error). A background launch ack ("Async agent launched") keeps it running.
  • A <task-notification> pairs back to the spawning call via <tool-use-id> and settles the background agent. Notifications can land between turns on a kept-alive CLI, so they're scanned before the active-run guard in onEvent.
  • CLI death (idle reap, param change, thread delete, quit) settles any still-running rows so the panel never shows a live badge for a dead agent.

Rows reach the renderer on the existing thread:updated push (getThreadDetail returns the raw thread record — no new IPC). The Agents tab renders a Subagents section in all non-workflow views, reusing TeamRow with the agent type in the provider slot. Done rows stay listed (per the issue's expectation), unlike orchestration workers which drop out — subagent rows are bounded per thread.

Tests

  • electron/test/claude.test.js: new subagents fake-CLI scenario — asserts sync→done, background stays running after its launch ack, task-notification settles it, and rows reach thread:updated.
  • test/teamView.test.tsx: panel renders the Subagents section with status badges and agent type.
  • npm run test:electron and npm run test:renderer pass at the same counts as the clean baseline (pre-existing flakes/failures: two-turn spawn race in fork-handoff/claude resume, orch-server env failures, memory-wiring scope test); tsc --noEmit clean.

🤖 Generated with Claude Code

The panel only listed threads Solenta itself creates, so subagents
spawned inside a Claude Code session (Agent tool) were invisible
(issue #21). The CLI runs them internally; the only trace is its
stream. Track them there:

- tool_use named Agent/Task registers a row on the thread record
  (description, subagent_type, running), capped to the newest 20
- a sync agent's tool_result settles it done/failed; a background
  launch ack ("Async agent launched") keeps it running
- a <task-notification> pairs back via <tool-use-id> and settles the
  background agent — scanned before the run guard, since notifications
  can land between turns on a kept-alive CLI
- CLI death (idle reap, param change, delete, quit) settles any
  still-running rows so a dead agent never shows a live badge

Rows flow to the renderer on the existing thread:updated push; the
Agents tab renders a Subagents section reusing TeamRow, with the
agent type in the provider slot.

Closes #21

Co-Authored-By: Claude Fable 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 5dd54e6 into main Aug 14, 2026
@currentbits
currentbits deleted the coder/research-agents-background-subagents-not-0c68c3 branch October 3, 2026 16:07
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.

Research agents (background subagents) not visible in the agents panel

1 participant