Repository navigation
fix(channels): remove stale pre-tool previews from Slack and Telegram - #147106
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper review Please review head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 1:59 PM ET / 17:59 UTC (Revision 7). ClawSweeper reviewWhat this changesRemoves abandoned Slack and Telegram streaming previews across tool calls while preserving accepted answers, useful failure notices, and Slack context followed by human replies. Merge readiness✅ Ready for maintainer review This remains a useful fix that current main does not contain. The new Telegram timeline resolves the previous proof blocker, and this review found no actionable code or security defect. Priority: P2 Review scores
Verification
How this fits togetherSlack and Telegram preview handlers turn streamed assistant text and tool events into temporary chat messages. They coordinate edits, final delivery, and cleanup so provisional text does not remain beside the accepted reply. flowchart TD
A[Assistant text and tool events] --> B[Channel preview handler]
B --> C[Temporary chat preview]
C --> D{Accepted answer or human context?}
D -->|Yes| E[Preserve conversation message]
D -->|No| F[Retire provisional preview]
B --> G[Final answer or failure notice]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +50, Tests +489, Other +63. Total +602 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep preview retirement with the existing channel owners, preserving accepted content and human context without changing streaming settings or provider replay. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a concrete path: partial text becomes visible before a tool call, then survives a tool-only response or contaminates terminal-error recovery. The supplied baseline results corroborate it; this review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes. The patch repairs existing preview lifecycle owners, reuses Telegram's deferred deletion, and retains meaningful answer and human-context exceptions without adding a competing delivery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 201f11afefdb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
@clawsweeper re-review Please review the updated exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Final proof and landing disposition for
Exact-head CI and its required gate are green: 118 successful jobs, 16 skipped, zero failed. Standard plugin coverage passed 160 Slack files / 3,016 tests and 223 Telegram files / 4,176 tests. CI tested merge Revisions 5 and 6's proof moves and redacted-timeline request are complete. The later exact-head Revision 7 explicitly accepts the supplied runtime evidence and lists no remaining before-merge item or code/security finding. Native review/prepare/merge completed, squashing the reviewed head as ec049f94608c; native completion receipt. Post-merge verification confirmed the exact reviewed patch at the landed parent and main ancestry. This preserves the distinction between reused pre-merge runtime proof and post-merge source verification. No score refresh was requested or bot-owned label manually changed. The broader issue remains open for its original iMessage/Claude Opus and separate producer/replay paths. |
|
Merged via squash.
|
* commit '2d87daf04b78992382299d552f15ac84a86a23ed': (1815 commits) fix(ui): distinguish tool activity with semantic icons (#147207) fix(linux): recover completed Quick Chat replies without resending (#146048) feat(desktop): unify Tauri title bar and window controls (#147097) refactor(test): share plugin fixture server shims (#147225) perf(gateway): defer worker workspace execution imports (#143496) fix(gateway): post-ack webhook work fails with "Async work scope is closed" (#144801) refactor(scripts): centralize upgrade survivor version floors (#146975) fix(ci): check publication registries before FRV fanout (#147184) fix(qa): align system-agent delegation with channel contracts (#145905) improve: reduce repeated chat message identity work (#147210) fix(channels): remove stale pre-tool previews from Slack and Telegram (#147106) fix: keep catalog discovery scoped and execution lazy (#147159) fix: serialize reclamation worker shutdown with foreground writes (#147178) test(sessions): cover abrupt committed transcript recovery (#143984) fix: stop transcript storms during context overflow recovery (#147202) fix: reduce CPU overhead for small history and usage reads (#147205) fix: resume tasks after tools finish and the model times out (#147203) refactor(scripts): share SQLite reliability message waits (#146900) feat(exec): configure approval reviewer thinking and fastMode (#147192) test: remove redundant Bonjour module headers (#146981) ...
…openclaw#147106) * test(channels): reproduce pre-tool preview retention * fix(channels): remove stale pre-tool previews from Slack and Telegram * fix(channels): preserve human preview context through final cleanup * test(telegram): assert retirement of unaccepted previews
Related: #25592
Landed via native squash as ec049f94608c. Native completion receipt.
What Problem This Solves
Pre-tool assistant text can remain as extra Slack or Telegram messages when partial streaming crosses tool boundaries, even after the runtime correctly excludes that text from the final answer.
User Impact
Partial streaming keeps the final answer or useful failure notice without abandoned pre-tool previews. Slack previews that someone already replied to remain conversation context. Automatic replies, accepted answer blocks, and opt-in tool progress remain available.
Why This Change Was Made
The transport preview owns its cleanup until an answer is accepted. Telegram materializes accepted blocks, retires provisional text at a new tool start, and fences delayed receipts from restoring retired text. Slack reuses a preview across internal model messages, records human detachment at the conversation boundary, and uses confirmed delivery to avoid duplicate cleanup. Failed deletions and explicit turn rotations remain eligible for cleanup.
This covers the verified Slack/Telegram preview-lifecycle subcases in the linked issue. Earlier phase-classification and terminal-answer fixes are already shipped. The independent provider-replay work in #102173 and Claude CLI work in #121567 remain separate. This PR does not claim new live qualification of the original iMessage/Claude Opus scenario or close the broader issue.
Evidence
Candidate:
bd2a42621aec221f785bc8d5459e57ac6ba4119e.1caf982ed6425b4a62b198445ba91e3a91096bc2reproduced the Slack retention assertion and five Telegram assertions: the tool-only boundary, both terminal-error modes, and delayed send/edit recovery. Retained runtime diagnostics show test-body assertion failures; setup errors are excluded.[0, 1, 2], final sent once, abandoned preview deleted, final alone retained. The Gateway verdict below is copied from the SHA-bound run receipt.1cedf3fd1bfe2fb987c54efb7917f6b5b7f42ca8, whose parents are3243939fd651a49a3990cc403163fc6fc4baa63eand this candidate. The Control UI gate passed with the upstream budget fix; this PR changes no UI budget.[0, 1, 2]confirms the tool-only middle response. The preamble and tool-progress messages were permanently deleted, leaving only the final. With tool progress disabled, the terminal-error case observed counts[0, 1], permanent preamble deletion, and exactly one canonical failure notice. Both recordings completed; QA credential leases and owned Gateway/mock processes were released. The isolated AWS leases also completed provider cleanup.{ "kind": "mock-gateway", "sha": "bd2a42621aec221f785bc8d5459e57ac6ba4119e", "channel": "slack", "status": "pass", "providerApi": "openai-completions", "previewWasVisible": true, "toolResultCounts": [ 0, 1, 2 ], "remainingMessages": [ "PREVIEW_FINAL_25592" ] }Observed Test Server outcomes, summarized from the SHA-bound receipts:
{ "kind": "live-telegram", "sha": "bd2a42621aec221f785bc8d5459e57ac6ba4119e", "providerApi": "openai-completions", "status": "pass", "scenarios": [ { "scenario": "preview-tool-boundaries", "recordingComplete": true, "preambleSeen": true, "toolProgressSeen": true, "providerToolResultCounts": [ 0, 1, 2 ], "remainingMessages": 1, "provisionalPreviewPermanentlyDeleted": true }, { "scenario": "preview-tool-error", "recordingComplete": true, "preambleSeen": true, "toolProgressSeen": false, "providerToolResultCounts": [ 0, 1 ], "remainingMessages": 1, "provisionalPreviewPermanentlyDeleted": true, "terminalNotice": "LLM request failed: provider rejected the request schema or tool payload." } ] }Redacted Telegram recorder timeline (elapsed milliseconds from each recording; message aliases are local to each scenario):
This timeline fulfills Revision 6's requested redacted message/edit/delete evidence. The provider trace, rather than the Telegram observer, establishes the tool-result sequences shown above.
Review and Proof Disposition
The proof requests from ClawSweeper Revisions 5 and 6 are fulfilled. Revision 7 explicitly accepts the supplied runtime evidence, reports no actionable code or security finding, and lists no remaining before-merge item. Native review, hosted-CI preparation, pinned-head squash, and post-merge verification completed. The landed patch matches the reviewed change; no new test execution on the squash commit is claimed. Bot-owned labels and review markers were not manually changed. Issue25592 remains open for its broader original-channel/provider scope.
Production: +80/-30 (net +50), justified by preview ownership and stale-receipt fencing. Tests and proof fixtures: +688/-136. No configuration, plugin SDK, protocol, or storage-schema change.