Skip to content

feat: Chat hierarchy threading with agent tree selector#9

Merged
rogerchappel merged 5 commits into
mainfrom
feature/chat-hierarchy-threading
Apr 2, 2026
Merged

feat: Chat hierarchy threading with agent tree selector#9
rogerchappel merged 5 commits into
mainfrom
feature/chat-hierarchy-threading

Conversation

@rogerchappel
Copy link
Copy Markdown
Owner

What

Adds hierarchical chat threading — each agent owns their own conversation thread, with a tree-based agent selector in the chat UI.

Changes

New: AgentTreeSelector component

  • Builds agent tree from reportsTo field
  • Recursive rendering with depth-based indentation
  • Status dots (green/yellow/grey), unread badge, active highlight
  • Exports findDefaultAgent() and findParentAgent() helpers

Modified: chat/page.tsx

  • Replaced flat agent dropdown with <AgentTreeSelector>
  • Per-agent localStorage keys (crewcmd-chat-{callsign}) — switching agents saves/loads separate thread histories
  • activeSessionKey derived from selected agent's callsign, passed to /api/chat as the agent param
  • Chat header shows agent title + "Reports to: {parent}" or "Team Lead"
  • unreadCounts state ready for cross-thread notifications

Spec

  • docs/specs/chat-hierarchy-threading.md — full design spec

Testing

  • TypeScript compiles cleanly
  • Rebased on main (includes STT/TTS cascade work)

rogerchappel and others added 5 commits April 2, 2026 09:53
- New AgentProfilePanel component (480px slide-out from right)
- Tabs: Summary, Skills, Config, Activity
- Clicking any agent card opens the panel (replaces direct edit dialog)
- Edit buttons within panel bridge to existing EditAgentDialog
- Focus trap, ESC to close, backdrop click to close
- Loading skeletons for all tabs
- Agent color used for accent bar, tab states, activity icons
Clicking the agent name/callsign on cards now opens the slide-out
panel (same as clicking anywhere else on the card). The detail page
link is still accessible from the panel header.
- Added Terminal tab with AgentOutputViewer (live logs)
- Added AgentControlPanel (start/stop/restart) to panel header
- Replaced /agents/[callsign] page with redirect to /team
- Updated all internal links (dashboard, agent-card, org-chart,
  team-canvas) to route through /team instead of detail page
- No more navigating away from the team page to manage agents
Replace flat agent dropdown with hierarchy-aware tree selector that
renders agents in their reportsTo tree structure. Each agent gets their
own thread backed by a gateway sessionKey (the agent's callsign).

- Add AgentTreeSelector component with recursive tree rendering,
  unread badges, status dots, and depth-based indentation
- Per-agent localStorage for thread messages (keyed by callsign)
- Default selection to top-level agent (team lead)
- Chat header shows agent title + reporting chain
- Unread count tracking state for cross-thread notifications
- Input placeholder shows active agent callsign

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@rogerchappel rogerchappel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change

@rogerchappel rogerchappel merged commit 8edb0a5 into main Apr 2, 2026
1 check 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