How the agent system works from a user experience perspective
From user message to streamed response -- the core request lifecycle
Parent agent spawns specialist sub-agents for complex tasks via the SubagentOrchestrator
From LLM tool_call to execution result, with filtering and tiered approval
Default. Every flagged tool requires explicit user confirmation before execution.
Auto-approves common write operations. Still gates critical and destructive tools.
Everything auto-passes except a hardcoded critical blacklist that NEVER auto-passes.
From skill discovery to installation to pattern promotion across scopes
SSE events from the server and how the chat UI renders each one
| SSE Event | Payload | UI Rendering |
|---|---|---|
| token | {content: "..."} |
Appended to the assistant message bubble character by character, creating the typing effect |
| step | {content: "Recalling..."} |
Shows a status indicator below the message -- "Recalling relevant memories...", "GEPA: Expanded prompt", budget warnings |
| tool | {name, input} |
Tool execution card appears: tool name, collapsible input preview, spinning indicator while running |
| tool_result | {name, result, duration, isError} |
Tool card updates: shows result preview, duration badge, green check or red X for errors |
| gepa_choices | {original, expanded, choices} |
Expansion card with original vs expanded prompt comparison; clickable choices for ask-first mode |
| approval_required | {toolName, args, riskLevel} |
Confirmation dialog: tool name, argument preview, risk level badge, Approve / Deny buttons |
| model_switch | {model, reason, primary} |
Toast notification: "Switched to [model] -- [reason]" with the original model shown |
| file_created | {filePath, fileAction} |
File creation badge in the message footer -- clickable to open the file in the workspace |
| notification | {type, title, body} |
System notification toast (e.g., "Auto-saved 3 memories from this exchange") |
| done | {content, usage, toolsUsed} |
Message finalized. Token counter updates. Tool summary shown. Loading state cleared |
| error | {message} |
Red error banner in the chat. If retryable, a "Retry" button appears |
State-machine templates for multi-step tasks with phase gates and trace recording