feat(desktop): open chat subagents in stacked right panes
Closed
HA
3mo ago+843+843+012345678901234567890123456789-1-1-0123456789
What & why
When a Mastra chat agent spawns subagents, their activity was only visible inline in the parent chat (or after navigating into nested tool UI). This adds automatic side panes so you can watch the parent and each subagent at once — first subagent opens to the right of the parent chat; later ones stack underneath that column.
- New
subagentpane kind bound to{ parentSessionId, toolCallId } - Auto-open on new
activeSubagentsentries (idempotent pertoolCallId) - Live activity from harness state, with message-history fallback after completion
Addresses the “display subagent activity in a new pane” request (#5077).
How I tested it
-
image:
-
Unit tests:
openSubagentPane(open right / stack / focus existing)resolveSubagentEntries(live map vs message history vs fallback)
-
Manual (v2 workspace Chat pane, not terminal agents):
- Open
+→ Chat - Prompt: “Use 2–3 explore subagents in parallel to investigate X, Y, and Z.”
- Confirm stacked right panes open and update while subagents run
- Open
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (CI fails on lint warnings too) - "Allow edits from maintainers" is checked on fork PRs
Summary by cubic
Chat subagents now open in stacked right panes so you can watch the parent chat and each subagent at the same time. First opens to the right; later ones stack in the same column, and we don’t refocus if the pane already exists. Addresses #5077.
- New Features
- Added a
subagentpane keyed by{ parentSessionId, toolCallId }with live updates and message-history fallback. - Auto-open from
activeSubagents; idempotent pertoolCallId; skips existing panes (no focus steal). - Layout: opens to the right of the parent chat; subsequent subagents stack underneath.
- Introduced
useAutoOpenSubagentPanes,openSubagentPane, andSubagentPane/SubagentPaneTitlewith tests for open/stack/no-refocus and entry/title resolution.
- Added a
Summary by CodeRabbit
- New Features
- Added dedicated subagent panes to the workspace dashboard.
- Automatically opens subagent panes as activity begins, avoiding duplicates.
- Displays subagent status, task details, results, errors, and execution information.
- Organizes multiple subagent panes beside the related chat and focuses existing panes when applicable.
- Added descriptive subagent titles and a Bot icon for easier identification.