feat: nest subagent sessions inside parent tile#22
Merged
Conversation
Subagents now appear nested within their parent session card instead of as separate dashboard tiles. Completed subagents are hidden from the tile (live command center view) but remain visible as expandable "Spawned Agent" blocks in the transcript history. Backend: - Add parent_session_id and agent_type columns to sessions table - SubagentStart/Stop hooks create linked subagent sessions with parent ref - API nests subagents array inside parent session responses - WebSocket initial_state and broadcasts include nested subagents - File watcher detects subagent transcript paths and sets parent link Frontend: - Dashboard tiles show collapsible active subagent rows with status/type/duration - WebSocket updates for subagents route to parent card (never create tiles) - Expand state persists across real-time re-renders - Transcript view renders Agent tool calls as "Spawned Agent" blocks with type badge, prompt, result summary, and expandable full conversation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d14802a to
b478d12
Compare
Unit Test Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The agent tool result's `content` field can be an object, not just a string. Coerce to String() before calling substring to prevent TypeError that silently broke the entire transcript rendering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the watcher processes new JSONL entries for a session, it now updates last_activity_at. If the session was marked stale but new entries are arriving (user resumed the session), it resets status to idle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The tile now only shows subagents with status "working". When none are running, shows a subtle "N subagents completed" label. When some are running with others done, shows "N running (M done)". This keeps the command center focused on what's in flight right now. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the "N subagents completed" label entirely. The tile is a live command center — if nothing is running, show nothing. Completed subagent history lives in the transcript view only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the watcher creates a subagent session from a transcript file, set status to "working" so it appears on the tile. Previously it defaulted to "idle" which the tile filter excluded, making subagents invisible when hooks go to a different port. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Screenshots
Dashboard tile with nested subagents
Transcript view with Spawned Agent block
Changes
Backend (db.py, hooks.py, api.py, ws.py, watcher.py):
parent_session_idandagent_typecolumns on sessions tableSubagentStart/SubagentStophooks create linked subagent sessionsFrontend (dashboard.js, app.js, terminal.js, style.css):
Tests: 9 new tests across test_db.py, test_hooks.py, test_api.py (264 total, all passing)
Closes #19
Follow-up: #21 (real-time streaming of subagent transcripts)
Test plan
🤖 Generated with Claude Code