fix(discord): reset progress drafts across queued turns#102341
Merged
steipete merged 14 commits intoJul 11, 2026
Conversation
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (7 earlier review cycles)
|
xialonglee
marked this pull request as draft
July 9, 2026 02:49
xialonglee
marked this pull request as ready for review
July 9, 2026 08:27
xialonglee
marked this pull request as draft
July 10, 2026 02:31
… 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 openclaw#100782 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: xialonglee <[email protected]>
steipete
force-pushed
the
fix/issue-100782-tool-results-image
branch
from
July 11, 2026 08:53
5dd74f5 to
2041038
Compare
xialonglee
marked this pull request as ready for review
July 11, 2026 08:56
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: xialonglee <[email protected]>
Co-authored-by: Peter Lee <[email protected]>
Co-authored-by: Peter Lee <[email protected]>
Co-authored-by: Peter Lee <[email protected]>
Contributor
|
Land-ready maintainer verification for final PR head
Known proof gap: the passed live Discord canary does not drive deterministic multi-tool progress plus queued retry behavior. I am not claiming that narrower scenario as live E2E proof; the regression is covered at the real message-process and Discord REST draft-stream boundaries. |
| duplex: "half", | ||
| }); | ||
| } as RequestInit & { duplex: "half" }; | ||
| const upstreamRes = await fetch(upstreamUrl, upstreamInit); |
Contributor
|
Merged via squash.
|
vincentkoc
added a commit
that referenced
this pull request
Jul 11, 2026
* origin/main: fix(cron): abort superseded reconciliation hooks (#104368) ci(release): expose Telegram runtime preflight stage (#104387) fix(status): avoid false shell-wrapper audit warnings (#81778) fix: retry live Gateway readiness proof (#104374) fix(exec-approval): stop misattributing Allow Always unavailability to policy (#97740) fix: preserve Mac bundle during live builds (#104376) chore(docs): translate with GPT-5.6 xhigh test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (#104361) fix(ui): hide group submenu separator when New group is the only entry (#104370) fix(discord): reset progress drafts across queued turns (#102341) docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (#94999) fix(discord): single-source thread-binding default placement and guard artifact parity (#104342) fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (#95536) fix(maint): reuse recent same-PR hosted gates (#104355)
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 12, 2026
) * fix(discord): guard progress draft collapse to prevent re-collapse on cleaned stream Commit c23e391 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 openclaw#100782 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * 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 <[email protected]> * fix(discord): retain progress receipt on retry Co-authored-by: xialonglee <[email protected]> * fix(discord): rearm queued progress drafts Co-authored-by: xialonglee <[email protected]> * test(discord): assert progress lifecycle outcomes Co-authored-by: xialonglee <[email protected]> * fix(discord): reset queued progress turn state Co-authored-by: xialonglee <[email protected]> * test(discord): model recreated progress drafts Co-authored-by: xialonglee <[email protected]> * fix(discord): serialize progress draft rotation Co-authored-by: xialonglee <[email protected]> * fix(discord): isolate queued draft generations Co-authored-by: Peter Lee <[email protected]> * test(discord): align synchronous draft rotation Co-authored-by: Peter Lee <[email protected]> * fix(discord): distinguish draft rotation ownership Co-authored-by: Peter Lee <[email protected]> * chore: keep release notes in pull request --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 12, 2026
* origin/main: fix(cron): abort superseded reconciliation hooks (openclaw#104368) ci(release): expose Telegram runtime preflight stage (openclaw#104387) fix(status): avoid false shell-wrapper audit warnings (openclaw#81778) fix: retry live Gateway readiness proof (openclaw#104374) fix(exec-approval): stop misattributing Allow Always unavailability to policy (openclaw#97740) fix: preserve Mac bundle during live builds (openclaw#104376) chore(docs): translate with GPT-5.6 xhigh test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (openclaw#104361) fix(ui): hide group submenu separator when New group is the only entry (openclaw#104370) fix(discord): reset progress drafts across queued turns (openclaw#102341) docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (openclaw#94999) fix(discord): single-source thread-binding default placement and guard artifact parity (openclaw#104342) fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (openclaw#95536) fix(maint): reuse recent same-PR hosted gates (openclaw#104355)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Discord progress previews could be collapsed more than once when a turn emitted repeated final payloads. The original collapse latch also remained sticky across queued turns, while receipt state was consumed before Discord confirmed delivery. Together those paths could duplicate activity receipts, lose a receipt on retry, or leave a queued turn using stopped/stale draft state.
Why This Change Was Made
This rewrite makes the lifecycle turn-scoped and commit-based:
This is intentionally not marked as fixing #100782. That report's image-placeholder symptom was previously attributed to the collapse latch without evidence; the behavior proven here is Discord progress receipt and queued-draft lifecycle correctness.
User Impact
Discord progress turns now produce exactly one activity receipt. A failed final can retry without losing the receipt, queued tool turns get a fresh preview and independent counters, and queued text-only turns do not receive a synthetic tool receipt. Late completion of an older preview create cannot corrupt the active turn.
Evidence
run_9e35ddfb3915): 150 focused Discord/compositor tests passed on Linux Node 24, including repeated finals, delivery retry, queued tool/text turns, cleanup, stale-create races, and block-mode preservation.Live-proof gap: the current Discord canary verifies transport connectivity but does not drive deterministic multi-tool progress plus queued retry behavior. The regression is therefore proven at the real message-process and REST draft-stream boundaries, not claimed as a live end-to-end Discord scenario.