Files
openclaw/extensions
Peter Lee ef95c5d74e fix(discord): reset progress drafts across queued turns (#102341)
* fix(discord): guard progress draft collapse to prevent re-collapse on cleaned stream

Commit 86ea382 added a progressDraftStartedBeforeFinal latch that snapshots
hasStarted at markFinalReplyStarted time. This correctly preserves collapse
eligibility when an abort cancels the compositor gate before
shouldCollapseProgressDraft runs.

However the latch was never cleared. After markPreviewFinalized turned the
draft into a summary, hasProgressDraftStarted remained true permanently. In
multi-tool turns with multiple final-payload deliveries, this caused
shouldCollapseProgressDraft to re-trigger collapse on an already-cleaned or
sealed draft stream, corrupting downstream delivery state and causing tool
results to render as image content blocks instead of text.

Fix: add a progressDraftCollapsed guard set by markPreviewFinalized that
prevents hasProgressDraftStarted from returning true after the draft has been
collapsed into a summary. Reset the guard on handleAssistantMessageBoundary
so followup/queued turns start fresh.

Per Discord channel session, all tool results rendered as image content
blocks. Model received (see attached image) placeholders instead of text.

Fixes #100782

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(discord): use valid table/chunk mode literals in collapse-guard tests

* test(discord): add abort-race gate-cancellation latch survival test

* fix(discord): consume progress draft collapse once

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* fix(discord): retain progress receipt on retry

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* fix(discord): rearm queued progress drafts

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* test(discord): assert progress lifecycle outcomes

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* fix(discord): reset queued progress turn state

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* test(discord): model recreated progress drafts

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* fix(discord): serialize progress draft rotation

Co-authored-by: xialonglee <li.xialong@xydigit.com>

* fix(discord): isolate queued draft generations

Co-authored-by: Peter Lee <xialonglee@users.noreply.github.com>

* test(discord): align synchronous draft rotation

Co-authored-by: Peter Lee <xialonglee@users.noreply.github.com>

* fix(discord): distinguish draft rotation ownership

Co-authored-by: Peter Lee <xialonglee@users.noreply.github.com>

* chore: keep release notes in pull request

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-11 02:59:29 -07:00
..