-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: post-dispatch chat.send rejection can overwrite terminal abort #90999
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.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.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.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
If
chat.aborthas already made achat.sendrun terminal, a later post-dispatch rejection from the same run can overwrite the cached terminal abort withstatus:"error"and broadcast an error.Steps to reproduce
mainat59a8137b04.chat.send, lets dispatch begin, callschat.abortfor the same run, then rejects the dispatch promise after the abort.node scripts/run-vitest.mjs src/gateway/server.chat.gateway-server-chat-b.test.ts.Expected behavior
The terminal abort should remain the terminal
chat.sendresult. A same-run dispatch rejection that arrives after the abort should not rewritechat:<runId>tostatus:"error"or emit a late chat error for that already-aborted run.Actual behavior
The regression fails on current
main: thechat:<runId>dedupe entry becomes{ runId, status:"error", summary:"Error: dispatch exploded after abort" }instead of the expected terminal timeout/aborted payload.OpenClaw version
Current
mainat59a8137b04.Operating system
Linux source checkout.
Install method
Source checkout; repro uses
node scripts/run-vitest.mjs.Model
N/A --- source-level Gateway repro; no model request is invoked.
Provider / routing chain
N/A --- source-level Gateway repro; no provider routing path is invoked.
Additional provider/model setup details
N/A --- the repro controls the Gateway handler dispatch/abort ordering directly; no provider or model setup is involved.
Logs, screenshots, and evidence
Impact and severity
Affected: Gateway clients that retry or observe terminal
chat.sendresults after aborting a run whose dispatch later rejects.Severity: Medium; the run was already terminally aborted, but the later rejection can present the outcome as a dispatch error.
Frequency: deterministic for this post-dispatch abort/rejection ordering.
Consequence: clients can see stale error state for an already-aborted run, and same-run retry observes the wrong cached terminal status.
Additional information
A fix should preserve two orderings separately: abort-before-dispatch-reject keeps the abort terminal; dispatch-reject-before-late-abort keeps the error terminal and clears any late abort tombstone so a later same-id retry cannot replay the stale abort.