-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Discord progress draft is deleted after final error reply #86395
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.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.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.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
Give feedbackNo fields configured for issues without a type.
Summary
When Discord progress draft previews are enabled, a final error reply can cause the previous progress/status draft message to be deleted during cleanup.
The final error message is delivered as a separate final reply, but the draft preview controller is not marked as having delivered a final reply when
payload.isError === true. As a result,cleanup()treats the turn as if no final reply was delivered and clears the existing progress draft.Observed behavior
This makes it harder to inspect what happened before the failure, because the visible progress/status history disappears at the end of the turn.
Expected behavior
Once a final error reply has been successfully sent to Discord, the draft preview controller should treat the turn as terminally delivered and should not delete the previous progress/status draft during cleanup.
This issue is separate from a possible future UX improvement where the draft preview could be sealed with a final failed state such as
Failed: .... The minimal bug fix is just to prevent cleanup from deleting the draft after a final error reply has been delivered.Code path
Installed package inspected:
openclawversion:2026.5.22dist/message-handler.process-Cs0IxLet.jsRelevant cleanup logic in
createDiscordDraftPreviewController():Relevant delivery logic near the final Discord send path:
Because final error replies skip
markFinalReplyDelivered(), cleanup later seesfinalReplyDelivered === falseand clears the progress draft.Local hotfix tested
I applied the following local dist hotfix:
node --check dist/message-handler.process-Cs0IxLet.jspasses after the change, and the gateway was restarted so the hotfix is active locally.Suggested fix
For a source-level fix, mark final error replies as terminally delivered after
deliverDiscordReply()succeeds.Possible implementation options:
payload.isError === true, asfinalReplyDelivered.finalResponseDelivered/finalTerminalReplyDeliveredif the currentfinalReplyDeliveredname was intended to mean only non-error assistant replies.The first option is likely the smallest behavioral fix.