-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: chat.abort fails when called immediately after chat.send due to race condition #84176
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
When calling chat.abort immediately after chat.send (with the same runId), the abort operation sometimes fails because the abort controller has not been registered yet.
The issue occurs in src/gateway/server-methods/chat.ts (1927-1931):
const active = context.chatAbortControllers.get(runId);
if (!active) {
respond(true, { ok: true, aborted: false, runIds: [] });
return;
}
Steps to reproduce
Expected behavior
The chat.abort call should successfully abort the chat run even when called immediately after chat.send. The abort controller registration and the abort operation should be properly synchronized to prevent this race condition.
Actual behavior
Sometimes calling chat.abort immediately after chat.send fails, which is an occasional behavior
OpenClaw version
2026.5.7
Operating system
Ubuntu 22.04
Install method
pnpm dev
Model
qwen3.7
Provider / routing chain
default config
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response