Skip to content

feat(web): show where each subagent works in the Agents panel - #77

Open
adampeterhiggins wants to merge 2 commits into
mainfrom
ah/subagent-sidebar-details
Open

adampeterhiggins wants to merge 2 commits into
mainfrom
ah/subagent-sidebar-details

Conversation

@adampeterhiggins

@adampeterhiggins adampeterhiggins commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

The Agents panel didn't say where a subagent was working. You couldn't tell whether an agent was editing the thread's own worktree or a worktree of its own.

Each agent now shows its worktree by folder name: in the Agents list row, and as one line in the detail header with the branch and lines changed. Hovering that line shows the full path and branch, each with a copy button. A tag says how we know:

  • shared: the provider reported a folder, and it's the thread's own worktree.
  • isolated: the provider reported a different folder, for example a Claude agent launched with isolation: "worktree".
  • thread folder?: the provider doesn't report where subagents run, so the thread's folder is shown as an assumption.

Before / after

Before After
Agents list before list after list
Agent detail before detail after detail
Hover after hover

The screenshots use a real Claude thread copied into an isolated worktree database. That thread predates this change, so one task.updated fixture row per agent adds the workspace fields: one shared agent, and one isolated agent with a worktree and line counts.

How

  • Contracts: the task linkage gains optional cwd, worktreeBranch, isolation, linesAdded, and linesRemoved, and ingestion persists them. An absent cwd means unknown, not "same as the thread".
  • Claude:
    • isolation comes from the Agent tool's launch input.
    • Non-isolated agents get the session cwd, and nested agents inherit their owner's.
    • The Agent tool result's worktreePath, worktreeBranch, and toolStats arrive after the task settles, so the adapter sends them in a status-free task.updated. That's a metadata update and doesn't restart the task or change its liveness.
  • Codex: the child thread's thread/started carries thread.cwd, which CodexSessionRuntime used to drop. It now rides on the collab child identity.
  • OpenCode: child session.created events carry info.directory, which is now read.
  • Cursor, Grok, Antigravity: nothing they send includes a subagent cwd, so the UI falls back to the thread's folder, tagged as an assumption.
  • Client: deriveSubagentWorkspace in client-runtime compares the agent's cwd with the thread's worktree (or project root).
  • Web: AgentWorkspace.tsx renders the header line with its hover card and the row chip.
  • Surfaces: mobile doesn't render subagents, so this is web and desktop only. No new events or websocket traffic; the fields ride on existing task events.
  • Docs: updated docs/fork-differences.md and docs/user/thread-sidebar.md.

Verification

  • Focused tests pass for the new behavior: the client fold and workspace derivation, the Claude adapter (shared, isolated with a reported worktree, remote), the Codex runtime and adapter carrying thread.cwd, and the OpenCode child directory.
  • Web, server, client-runtime, and contracts typecheck clean. Targeted lint shows no errors; the only warnings are ones ChatView.tsx already had.
  • ThreadSettlementReactor.test.ts storage-cleanup tests fail locally in this ~/.t3 worktree. They don't touch any code changed here.

Model: Claude Opus 5.5. Harness: Claude Code through T3 Code.

🤖 Generated with Claude Code

adampeterhiggins and others added 2 commits September 30, 2026 10:56
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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