-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
interrupt queue mode replays previous assistant reply after abort #50145
Copy link
Copy link
Open
BingqingLyu/openclaw
#1026Labels
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:not-repro-on-mainClawSweeper found high-confidence evidence that this issue no longer reproduces on main.ClawSweeper found high-confidence evidence that this issue no longer reproduces on main.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: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.Thin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivityMarked as stale due to inactivity
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:not-repro-on-mainClawSweeper found high-confidence evidence that this issue no longer reproduces on main.ClawSweeper found high-confidence evidence that this issue no longer reproduces on main.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: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.Thin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug Description
When
messages.queue.modeis set to"interrupt", incoming messages that abort an active run cause the previous turn's assistant reply to be re-sent to the user, before the new (correct) reply is delivered.Steps to Reproduce
messages.queue.mode: "interrupt"in configExpected Behavior
When message B interrupts message A's run:
Actual Behavior
The aborted run delivers the last assistant message from session history as if it were the current run's output. This happens because:
buildEmbeddedRunPayloads(src/agents/pi-embedded-runner/run/payloads.ts): WhenassistantTextsis empty (abort happened before model generated new text), it falls back toextractAssistantText(lastAssistant). ButlastAssistantcomes frommessagesSnapshot(full session history), so it picks up the previous turn's reply.runReplyAgent(src/auto-reply/reply/agent-runner.ts): After an aborted run, the code still flushesblockReplyPipelineand processespayloadArray, potentially delivering stale content.Proposed Fix
Fix 1: Guard
lastAssistantfallback when aborted (run.ts)In the call to
buildEmbeddedRunPayloads, passnullforlastAssistantwhen the run was aborted and produced no new assistant text:Fix 2: Early exit in
runReplyAgentfor aborted runs (agent-runner.ts)Skip pipeline flush and payload delivery when the run was aborted:
Environment
interrupt