+ ```
+
+ 17. Remove the old `sendMessage` useSendMessage hook usage since streaming now handles sending. Keep the import for `useSendMessage` only if still needed for non-streaming fallback, otherwise remove.
+
+
+ pnpm --filter @paperclipai/ui build && pnpm --filter @paperclipai/ui test run
+
+
+ - grep -q "VList" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "virtua" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "ChatAgentBadge" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "isAtBottom" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "Jump to bottom" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "Pencil" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "RotateCcw" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "animate-pulse" ui/src/components/ChatMessageList.tsx returns 0
+ - grep -q "Square" ui/src/components/ChatInput.tsx returns 0
+ - grep -q "Stop generation" ui/src/components/ChatInput.tsx returns 0
+ - grep -q "parseMessageIntent" ui/src/components/ChatInput.tsx returns 0
+ - grep -q "SLASH_COMMANDS" ui/src/components/ChatInput.tsx returns 0
+ - grep -q "AgentSelector" ui/src/components/ChatPanel.tsx returns 0
+ - grep -q "useStreamMessage" ui/src/components/ChatPanel.tsx returns 0
+ - grep -q "useEditMessage" ui/src/components/ChatPanel.tsx returns 0
+ - grep -q "useUpdateConversationAgent" ui/src/components/ChatPanel.tsx returns 0
+ - grep -q "resolveAgentIdForIntent" ui/src/components/ChatPanel.tsx returns 0
+ - pnpm --filter @paperclipai/ui build exits 0
+ - pnpm --filter @paperclipai/ui test run exits 0
+
+ ChatMessageList uses VList with agent badges, edit/retry buttons, streaming indicator, and jump-to-bottom. ChatInput has Stop button, slash command popover, and @mention popover. ChatPanel integrates AgentSelector, streaming, edit, retry, and agent resolution. Build and all tests pass.
+
+
+
+
+
+- `pnpm --filter @paperclipai/ui build` — TypeScript compiles
+- `pnpm --filter @paperclipai/ui test run` — all UI tests pass
+- `pnpm test run` — full suite green
+- ChatMessageList uses VList from virtua
+- ChatInput shows Stop button during streaming
+- ChatPanel has AgentSelector in header
+- Slash commands and @mentions are parsed and routed
+
+
+
+1. Streaming tokens appear in a live assistant message bubble via EventSource
+2. Stop button (Square icon, destructive variant) replaces Send during streaming
+3. Retry button (RotateCcw) appears on hover over assistant messages
+4. Edit button (Pencil) appears on hover over user messages with inline textarea
+5. AgentSelector in ChatPanel header shows all agents and persists selection via PATCH
+6. VList virtualizes the message list for smooth scrolling with 1000+ messages
+7. Slash commands populate a popover and route to correct agent role
+8. @mention popover shows filtered agents and routes to named agent
+9. Jump to bottom button appears when user scrolls up
+10. All tests pass and build succeeds
+
+
+
diff --git a/.planning/phases/22-agent-streaming/22-04-PLAN.md b/.planning/phases/22-agent-streaming/22-04-PLAN.md
new file mode 100644
index 00000000..45c5de6f
--- /dev/null
+++ b/.planning/phases/22-agent-streaming/22-04-PLAN.md
@@ -0,0 +1,128 @@
+---
+phase: 22-agent-streaming
+plan: 04
+type: execute
+wave: 3
+depends_on: [22-03]
+files_modified: []
+autonomous: false
+requirements: [CHAT-01, CHAT-08, CHAT-10, CHAT-11, CHAT-12, INPUT-05, INPUT-06, AGENT-04, THEME-03, PERF-02, PERF-03]
+
+must_haves:
+ truths:
+ - "Full streaming chat flow works end-to-end"
+ - "All three themes render agent colors correctly"
+ - "All six success criteria from ROADMAP are met"
+ artifacts: []
+ key_links: []
+---
+
+
+Full test suite verification and visual/functional checkpoint for the complete Phase 22 agent streaming feature.
+
+Purpose: Ensures all automated tests pass and gives the user a chance to verify the streaming experience, agent selector, theme colors, and interaction flows visually.
+Output: Verified, working Phase 22.
+
+
+
+@$HOME/.claude/get-shit-done/workflows/execute-plan.md
+@$HOME/.claude/get-shit-done/templates/summary.md
+
+
+
+@.planning/PROJECT.md
+@.planning/ROADMAP.md
+@.planning/phases/22-agent-streaming/22-01-SUMMARY.md
+@.planning/phases/22-agent-streaming/22-02-SUMMARY.md
+@.planning/phases/22-agent-streaming/22-03-SUMMARY.md
+
+
+
+
+
+ Task 1: Full test suite verification and build check
+
+
+ server/src/__tests__/chat-stream-routes.test.ts,
+ server/src/__tests__/chat-routes.test.ts,
+ ui/src/lib/parseMessageIntent.test.ts,
+ ui/src/components/ChatAgentBadge.test.tsx
+
+
+ Run the full test suite and verify all tests pass:
+ ```bash
+ pnpm test run
+ ```
+
+ If any tests fail:
+ 1. Read the failing test file and the source file it tests
+ 2. Fix the issue (prefer fixing source code over weakening tests)
+ 3. Re-run until all tests pass
+
+ Then verify the build:
+ ```bash
+ pnpm --filter @paperclipai/ui build
+ pnpm --filter @paperclipai/server build
+ ```
+
+ Report the total test count and pass rate.
+
+
+ pnpm test run && pnpm --filter @paperclipai/ui build && pnpm --filter @paperclipai/server build
+
+
+ - pnpm test run exits 0
+ - pnpm --filter @paperclipai/ui build exits 0
+ - pnpm --filter @paperclipai/server build exits 0
+
+ All tests pass and both UI and server build cleanly
+
+
+
+ Task 2: Visual and functional verification of streaming chat
+
+
+ Present the verification checklist to the user. The user will manually test the streaming chat experience across all features built in Phase 22:
+
+ 1. Start the dev server: `pnpm dev`
+ 2. Open the chat panel (MessageSquare icon in sidebar)
+ 3. Create a new conversation and send a message — verify tokens stream in word-by-word
+ 4. While streaming: verify the Stop button (red square) appears; click it to cancel
+ 5. Hover over an assistant message — verify Retry button (rotate icon) appears; click it
+ 6. Hover over a user message — verify Edit button (pencil icon) appears; click to enter edit mode, modify text, click Regenerate
+ 7. Open the Agent Selector dropdown in the header — verify agents appear with colored avatars
+ 8. Select a different agent — verify it persists (reload page, re-open conversation)
+ 9. Type `/ask-pm ` — verify slash command popover appears with matching commands
+ 10. Type `@` followed by an agent name — verify mention popover appears
+ 11. Switch between all three themes (Catppuccin Mocha, Tokyo Night, Catppuccin Latte) — verify agent badge colors are distinguishable
+ 12. (Optional) If you have a conversation with many messages, scroll rapidly to check smoothness
+
+ User types "approved" or describes issues to fix
+
+ - User confirms streaming tokens appear as they are generated
+ - User confirms Stop button cancels in-progress stream
+ - User confirms agent badge shows on assistant messages with colored avatar
+ - User confirms agent selector changes the conversation's agent
+ - User confirms slash command and @mention popovers appear
+ - User confirms agent colors are distinguishable across all three themes
+
+ User has approved the complete Phase 22 streaming chat experience
+
+
+
+
+
+- Full test suite green
+- Build succeeds for both UI and server
+- User has visually verified the streaming experience
+
+
+
+1. All automated tests pass
+2. Build succeeds
+3. User approves the streaming experience
+
+
+