Agent Stop Button
What this covers
While the agent is streaming a response, the Send button transforms into a Stop button. Clicking it cancels the in-progress response immediately.
When the Stop button appears
The Stop button replaces the Send button whenever a server-sent events (SSE) stream is active — from the moment you send a message until the agent finishes its response. Once the response completes (or is cancelled), the button reverts to Send.
What happens when you click Stop
- The frontend fires an AbortController signal, which terminates the active
fetch()request. - The SSE stream closes immediately. Whatever tokens have already arrived remain visible in the chat.
- The conversation is left in a consistent state. You can send a new message or export the conversation as-is.
Limitations
- Frontend-only abort. Clicking Stop cancels the browser’s connection to the server. The backend LLM call may continue running until the server detects the closed connection.
- Partial responses. The assistant’s response will be truncated at whatever point the stream was when you clicked Stop. Send a follow-up message to continue.
- Token billing. Tokens generated by the LLM before the abort are still billed. The stop button reduces wait time, not cost.