fix(telegram): clear split reasoning previews#94631
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 20, 2026, 8:19 PM ET / 00:19 UTC. Summary PR surface: Source +11, Tests +30. Total +41 across 2 files. Reproducibility: yes. at source level. Current main sets splitReasoningOnNextStream on reasoning end, then calls forceNewMessage before clearing the old Telegram preview id; I did not run a live Telegram DM 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 detailsBest possible solution: Land the focused Telegram reasoning-lane cleanup after redacted live Telegram proof, or explicit maintainer acceptance of the proof gap, confirms split reasoning previews no longer leave stale messages. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main sets splitReasoningOnNextStream on reasoning end, then calls forceNewMessage before clearing the old Telegram preview id; I did not run a live Telegram DM reproduction in this read-only review. Is this the best way to solve the issue? Yes for the code shape. Clearing the reasoning lane before forceNewMessage is a narrow fix for the identified lifecycle bug and keeps answer/tool draft behavior unchanged; live Telegram proof remains the merge gate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6c2c43d63f4c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +11, Tests +30. Total +41 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
|
Summary
/reasoning streampreview cleanup when a reasoning segment ends and a later reasoning segment starts.forceNewMessage()resets the stream state, preserving the old preview id long enough for Telegram cleanup.forceNewMessage()and proves cleanup happens before the next reasoning preview update.Linked context
Closes #80862
Related #80862
Was this requested by a maintainer or owner?
No direct maintainer request; ClawSweeper marked the issue source-reproducible and queueable.
Real behavior proof (required for external PRs)
/reasoning streamsplit into a later reasoning message becauseforceNewMessage()reset the draft stream before the old preview id was cleaned up.node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/draft-stream.test.tsTest Files 2 passed (2); Tests 176 passed (176); [test] passed 1 Vitest shardforceNewMessage()and before the second reasoning preview update./reasoning stream; no Telegram credentials were used locally.sendMessagereasoning previews with no matchingeditMessageTextordeleteMessage; source showedforceNewMessage()dropped the old stream message id before cleanup.Tests and validation
node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/draft-stream.test.tsgit diff --check -- extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.tspnpm exec oxfmt --check --threads=1 extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.tsnode scripts/run-oxlint.mjs extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.ts.agents/skills/autoreview/scripts/autoreview --mode local --prompt "Review the staged/working-tree changes for issue #80862 only..."Regression coverage added:
onReasoningStream -> onReasoningEnd -> onReasoningStreamthat uses a draft stream whoseforceNewMessage()clears the message id, matching the real draft stream behavior.What failed before this fix, if known?
forceNewMessage()before cleanup, causing the previous Telegram reasoning preview message id to be lost and leaving the old preview in chat.If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. Telegram reasoning preview messages should no longer remain stale when reasoning is split into a later preview message.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No.
What is the highest-risk area?
Telegram draft preview lifecycle ordering for reasoning-only stream splits.
How is that risk mitigated?
The change is scoped to the reasoning lane's split path and uses existing draft-stream
clear()cleanup before starting the next preview message. Existing dispatcher and draft-stream focused tests pass, and autoreview reported no accepted/actionable findings.Current review state
What is the next action?
Open PR from
codex/fix-80862-telegram-reasoning-previewand request maintainer review; collect live Telegram proof if reviewers require transport-level validation.What is still waiting on author, maintainer, CI, or external proof?
CI and optional live Telegram DM proof are still pending after PR creation.
Which bot or reviewer comments were addressed?
Addressed the ClawSweeper issue analysis that identified
onReasoningEnd -> forceNewMessage()orphaning the reasoning preview cleanup.