Repository navigation
fix(discord): send fresh final messages after previews - #99711
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 8:03 PM ET / 00:03 UTC. Summary PR surface: Source -72, Tests -7. Total -79 across 4 files. Reproducibility: yes. for a source-level reproduction: current main can finalize ordinary Discord partial-preview finals by editing the preview message, and the linked issue supplies observed Discord created/edited timestamps for the missed highlight path. I did not run a live Discord client reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 findings
Review detailsBest possible solution: Repair the PR so ordinary partial-stream finals are fresh messages, @everyone/@here remains suppressed or stays on the safe edit path, and the author adds redacted real Discord proof before merge. Do we have a high-confidence way to reproduce the issue? Yes for a source-level reproduction: current main can finalize ordinary Discord partial-preview finals by editing the preview message, and the linked issue supplies observed Discord created/edited timestamps for the missed highlight path. I did not run a live Discord client reproduction in this read-only review. Is this the best way to solve the issue? No. Fresh final delivery is a plausible fix for the unread/highlight bug, but this implementation is too broad because it removes the existing @everyone/@here safety distinction without adding explicit mention suppression. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8fe917b4f778. Label changesLabel justifications:
Evidence reviewedPR surface: Source -72, Tests -7. Total -79 across 4 files. View PR surface stats
Security concerns:
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
|
9efa67a to
0041b7f
Compare
0041b7f to
695b8fc
Compare
|
Land-ready proof for exact head
Thanks @davelutztx for the original report and implementation direction. |
|
Merged via squash.
|
|
Nice that this landed for the missed-highlight issue. One follow-up concern from the review: fresh final sends should explicitly suppress @everyone / @here via allowed_mentions, or keep broadcast-containing finals on the safe edit path. I do not use broadcast pings myself, so this is not likely to affect my workflow directly, but it seems worth hardening so model-generated final text cannot accidentally notify a whole server. |
* fix(discord): send fresh final messages after previews * fix(discord): suppress broadcast mentions on fresh finals * docs(changelog): note Discord streamed final fix * fix(discord): stabilize targeted mention policy --------- Co-authored-by: Dave Lutz <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Discord partial streaming finalized an answer by editing the existing preview message. If the user left the channel during a long turn, that
MESSAGE_UPDATEdid not reliably advance Discord's unread/channel highlight, so a completed answer could arrive unnoticed.Fixes #99662.
Why This Change Was Made
The durable final now uses the normal send path, producing a fresh message after preview cleanup. This matches Discord's separate Create Message and Gateway message event contracts and removes the second in-place finalization path.
Fresh bot messages normally parse broadcast mentions, unlike the old edit path. The maintained version therefore carries an explicit
allowed_mentionspolicy through text, media, chunked, and forum delivery: targeted user and role pings remain enabled, while@everyoneand@herecannot escalate.User Impact
Evidence
0041b7ffa47e128242fc2f3bc2a55b4eb30985b1.tbx_01kww6wp8mafqazb1d425qyf36: 183 focused Discord tests passed;pnpm check:changedpassed extension production/test typechecks, full extension lint, and repository guards.run_ade515667559: the exact pushed fork head passed the same 183 focused tests with public networking, no Tailscale, no instance role, and no hydrated credentials.@everyoneproducedmention_everyone=false; both test messages deleted successfully with HTTP 204.Implementation Notes
finalEditsupport disabled while retaining normal fallback and preview cleanup.