# Agent Test Page ## Overview A sandbox for testing agent chat by selecting an agent and interacting through a streaming chat interface. ## Route `/utilities/testing/agent` Optional query parameter `?agent=` pre-selects the agent on load (used when navigating from an agent's detail page). ## Page Name "Agent Chat" for title and breadcrumb ## Page Layout ```text [Agent Chat] (page title / breadcrumb) ┌─────────────────────────────────────────────────────────────┐ │ Agent │ │ [Selected agent button] [Select agent] │ └─────────────────────────────────────────────────────────────┘ (no selection) (agent selected) ┌──────────────┐ ┌──────────────────────────────────────┐ │ Select an │ → │ Chat panel │ │ agent above │ │ │ └──────────────┘ └──────────────────────────────────────┘ ``` ## Agent Selector The selected agent is shown in the top selector button (icon + name). If no agent is selected, the page shows a placeholder prompt to select one. ## Chat Panel Provides a chat thread for sending messages to the selected agent. Behavior: - Supports optional system prompt input. - User messages are appended to the thread. - Assistant responses stream incrementally. - Send switches to Stop while a request is in flight. - Clear session resets messages, system prompt, and errors. - Enter sends and Shift+Enter inserts a newline. - Request errors are shown inline. ## API Behavior ### `POST /api/workspaces/[workspaceId]/agents/[id]/test` Runs a streaming chat completion request for the selected agent and returns assistant output as an event stream. Non-success responses return an error payload.