-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
optioAssigned to Optio AI agentAssigned to Optio AI agent
Description
Summary
Add an interactive Claude Code chat pane alongside the existing web terminal in sessions. This is Phase 2 of the sessions feature (#80) — Phase 1 (terminal + PR tracking) shipped in #93.
Motivation
Sessions currently give users a terminal into a repo pod, but no way to interact with an AI agent within that same workspace. The goal is a side-by-side experience: agent chat on the left, terminal on the right, both operating on the same worktree.
Features
Split pane layout
- Resizable split — agent chat (left) + terminal (right)
- Either pane collapsible to full-width
- Layout preference persisted (localStorage or session record)
Interactive agent chat
- Long-running
claudeprocess exec'd in the pod (not one-shot per message) — stdin/stdout piped through WebSocket (WS /ws/sessions/:id/chat) - Streaming responses rendered in a chat pane with markdown
- Tool use visibility — show files being read/edited and commands being run (reuse existing log viewer / agent event parser)
- Interrupt button — cancel the current response mid-stream
- Session history persists in scrollback even when navigating away and back
Terminal ↔ Agent coordination
- "Send to agent" action — select terminal output and send it as context to the chat (e.g. paste an error and say "fix this")
- Shared worktree means
git statusin the terminal immediately reflects agent edits and vice versa
Cost and tracking
- Live cost counter displayed in the session header (token spend so far)
- Per-message cost breakdown in the chat UI
- Model selector — pick which model the agent uses (default from repo
claudeModelsetting)
PR lifecycle (extending Phase 1)
- Trigger review agent on any session PR directly from the chat pane
- CI status / review status badges inline when a PR is detected
API
WS /ws/sessions/:id/chat— agent chat WebSocket (stdin/stdout + structured events)- Extend
GET /api/sessions/:idto include cost breakdown and model info - Extend
POST /api/sessions/:id/endto kill the claude process if running
Non-goals
- Multiple terminal tabs per session
- Auto-fix CI failures (user-driven only)
- Multi-agent (one claude process per session)
- Control plane agent ("chat with Optio" outside a repo context)
Follows
- feat: Interactive sessions — terminal + agent chat for repo pods #80 (original sessions spec)
- feat: add interactive sessions with terminal and PR tracking #93 (Phase 1 implementation)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
optioAssigned to Optio AI agentAssigned to Optio AI agent