fix(slack): retain delivered final replies during late cleanup#87364
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 27, 2026, 1:47 PM ET / 17:47 UTC. Summary PR surface: Source +18, Tests +36. Total +54 across 2 files. Reproducibility: Do we have a high-confidence way to reproduce the issue? Yes at source and unit level: current main still allows the draft adapter after normal final delivery, and the PR encodes the media-final followed by late-error sequence; I did not run tests or a live Slack repro because this review is read-only. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance: Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the Slack-scoped final-delivery guard with the regression test, after adding redacted live Slack proof or maintainer-run Slack smoke proof for the late-payload scenario. Do we have a high-confidence way to reproduce the issue? Do we have a high-confidence way to reproduce the issue? Yes at source and unit level: current main still allows the draft adapter after normal final delivery, and the PR encodes the media-final followed by late-error sequence; I did not run tests or a live Slack repro because this review is read-only. Is this the best way to solve the issue? Is this the best way to solve the issue? Yes for the code direction: the guard is Slack-scoped, preserves the shared live-preview fallback contract, and keeps the first fallback cleanup behavior intact; the remaining blocker is proof, not a different implementation shape. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 1806b152a919. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +18, Tests +36. Total +54 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
Maintainer landing proof:
Landing now. Thanks @tianxiaochannel-oss88. |
Summary
draftStream.clear()and delete a visible answer.Fixes #87363.
Root cause
Slack's
draftStream.clear()deletes the draft message. The dispatch path already protected in-place finalized previews withdraftPreviewCommitted, but a final reply can also become visible through normal or streaming delivery. A later same-turn payload could still reuse the draft finalizer whendraftPreviewCommittedwas false, reaching fallback cleanup and deleting the message.Real behavior proof (required for external PRs)
node scripts/test-projects.mjs extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts src/channels/message/lifecycle.test.ts -- --reporter=verbosedraftStream.clear()is called only for the initial normal-delivery fallback and is not reused for the late same-turn cleanup payload. The shared lifecycle tests still pass, confirming the generic first-fallback cleanup behavior remains intact.delivered reply to channel:[redacted]around2026-05-28 00:45:22 +08:00, followed by a Slackmessage_deletedsession event roughly 15 seconds later during the same broader recovery/error sequence. No token, account, full channel id, user id, session id, or full Responses item id is included.Tests and validation
node scripts/test-projects.mjs extensions/slack/src/monitor/message-handler/dispatch.preview-fallback.test.ts src/channels/message/lifecycle.test.ts -- --reporter=verboseRegression coverage added:
What failed before this fix:
draftStream.clear()because only in-place preview finalization setdraftPreviewCommitted.