Summary
When clicking "Stop" to abort a running chat session in the web UI, the chat input textarea is cleared — losing whatever text the user had typed. The user has to retype their message from scratch.
This is unexpected behavior. Stopping an AI response should not affect the user's draft input. Every major chat interface (ChatGPT, Claude.ai, etc.) preserves the input field contents when you stop a generation.
Steps to reproduce
- Open the Chat page in the gateway dashboard
- Send a message and wait for the AI to start responding
- While the response is streaming, type a new message in the input field
- Click "Stop" to abort the running session
- Expected: Input field retains the typed message
- Actual: Input field is cleared — typed message is lost
Expected behavior
The text should be persistent.
Actual behavior
In ui/src/ui/app-chat.ts, the handleAbortChat() function unconditionally sets host.chatMessage = "":
export async function handleAbortChat(host: ChatHost) {
if (!host.connected) {
return;
}
host.chatMessage = ""; // <-- clears user's draft unconditionally
await abortChatRun(host as unknown as OpenClawApp);
}
By contrast, handleSendChat() correctly preserves the draft:
- Saves to
previousDraft before clearing
- Restores on send failure
- Supports
restoreDraft flag
The abort handler has none of this logic.
OpenClaw version
OpenClaw v2026.2.20
Operating system
Self-hosted Docker deployment
Install method
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Suggested Fix
Remove the host.chatMessage = "" line from handleAbortChat(). Clearing the input is not necessary for the abort operation — abortChatRun() handles the server-side cancellation independently.
export async function handleAbortChat(host: ChatHost) {
if (!host.connected) {
return;
}
// Don't clear chatMessage — preserve the user's draft
await abortChatRun(host as unknown as OpenClawApp);
}
If there's a reason the input needs to be cleared during abort (e.g., as a signal), it should be saved and restored afterward:
export async function handleAbortChat(host: ChatHost) {
if (!host.connected) {
return;
}
const draft = host.chatMessage;
host.chatMessage = "";
await abortChatRun(host as unknown as OpenClawApp);
host.chatMessage = draft; // restore after abort completes
}
Summary
When clicking "Stop" to abort a running chat session in the web UI, the chat input textarea is cleared — losing whatever text the user had typed. The user has to retype their message from scratch.
This is unexpected behavior. Stopping an AI response should not affect the user's draft input. Every major chat interface (ChatGPT, Claude.ai, etc.) preserves the input field contents when you stop a generation.
Steps to reproduce
Expected behavior
The text should be persistent.
Actual behavior
In
ui/src/ui/app-chat.ts, thehandleAbortChat()function unconditionally setshost.chatMessage = "":By contrast,
handleSendChat()correctly preserves the draft:previousDraftbefore clearingrestoreDraftflagThe abort handler has none of this logic.
OpenClaw version
OpenClaw v2026.2.20
Operating system
Self-hosted Docker deployment
Install method
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Suggested Fix
Remove the
host.chatMessage = ""line fromhandleAbortChat(). Clearing the input is not necessary for the abort operation —abortChatRun()handles the server-side cancellation independently.If there's a reason the input needs to be cleared during abort (e.g., as a signal), it should be saved and restored afterward: