-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Overview
CodeFRAME currently supports one-way execution monitoring via SSE: the user watches the agent run, but cannot steer it mid-flight except through the blocker Q&A (which pauses the whole run). This issue tracks the full work needed to close the bidirectional agent chat gap — persistent, interactive sessions where users can send messages to a running agent and receive streaming token-by-token responses.
Problem
- The existing
POST /api/projects/{id}/chatendpoint returns complete responses and is wired to the Lead Agent only, not to a running coding agent - The existing
/wsWebSocket handles project status updates (subscribe/broadcast), not interactive message exchange - The web-ui has no sessions page, no chat panel component, no XTerm terminal, and no split-pane layout
- There is no concept of a persistent interactive session that can be paused and resumed
What "Done" Looks Like
- User can open a
/sessionspage and start a new interactive agent session against any workspace - Session opens a split-pane layout: agent chat on the left, terminal on the right
- Agent chat streams tokens in real-time (not wait-for-complete-response)
- Tool calls are displayed inline with collapsible input/output JSON
- Thinking blocks are rendered with distinct styling
- User can type a follow-up message and send it while the agent is idle
- User can interrupt the agent mid-thinking
- Sessions are persisted in the DB and listed on
/sessions; past sessions can be resumed - Cost and token counts update in real-time
Sub-issues (Atomic, Single-session Work)
Backend
- Backend: DB schema + CRUD API for interactive agent sessions #501 — DB schema + CRUD API for interactive agent sessions
- Backend: WebSocket endpoint for streaming agent chat (/ws/sessions/{id}/chat) #502 — WebSocket endpoint for streaming agent chat (
/ws/sessions/{id}/chat) - Backend: Streaming chat adapter for Anthropic SDK (token-by-token relay) #503 — Streaming chat adapter for Anthropic SDK (token-by-token relay)
Frontend
- Frontend: useAgentChat hook — WebSocket connection and message streaming #504 —
useAgentChathook (WebSocket connection, message accumulation, streaming) - Frontend: AgentChatPanel component — messages, tool calls, thinking blocks, input bar #505 —
AgentChatPanelcomponent (messages, tool calls, thinking blocks, input bar) - Frontend: AgentTerminal component — XTerm.js interactive terminal for session workspace #506 —
AgentTerminalcomponent (XTerm.js interactive terminal) - Frontend: SplitPane layout component — draggable, collapsible, persistent #507 —
SplitPanelayout component (draggable, collapsible, localStorage persistence) - Frontend: /sessions list page + sidebar navigation entry #508 —
/sessionslist page + sidebar nav entry - Frontend: /sessions/[id] detail page — wires SplitPane, AgentChatPanel, and AgentTerminal #509 —
/sessions/[id]detail page (wires everything together)
Dependency Graph
#501 (DB/API)
└─→ #502 (WS endpoint)
└─→ #503 (streaming adapter) ← backend complete
#504 (hook) ← requires #502 running
└─→ #505 (chat panel)
#506 (terminal)
#507 (split pane)
#508 (list page) ← requires #501 running
└─→ #509 (detail page) ← requires #504, #505, #506, #507
Existing Infrastructure
- WebSocket auth pattern:
codeframe/ui/routers/websocket.py - Lead Agent chat (non-streaming):
codeframe/ui/routers/chat.py - Session state endpoint:
codeframe/ui/routers/session.py - SSE streaming pattern:
codeframe/core/streaming.py+useEventSource.ts - DiscoveryPanel (closest existing chat UI):
web-ui/src/components/prd/DiscoveryPanel.tsx
Reactions are currently unavailable