fix(telegram): force fresh final after visible intermediate output (#76529)#76725
Conversation
|
Hi @civiltox @clawsweeper — picked this up. Would appreciate a look when you have time. |
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. at source level. Current main can send a visible block/error bubble after a short-lived Telegram preview and then edit that older preview into the final answer; the PR adds regression coverage for that sequence. Next step before merge Security Review detailsBest possible solution: Land the PR after required exact-head checks pass, preserving the fresh-final runtime path plus the regression test, Telegram docs, and changelog coverage. Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main can send a visible block/error bubble after a short-lived Telegram preview and then edit that older preview into the final answer; the PR adds regression coverage for that sequence. Is this the best way to solve the issue? Yes. Tracking the last successful visible non-preview send in the dispatcher and comparing it with the active preview timestamp is a narrow fix that avoids new configuration or broader delivery policy changes. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e2c8db2cad40. |
7545733 to
b11177d
Compare
|
Hi @steipete |
b11177d to
b5a61cd
Compare
|
Hi @steipete |
|
Landed via rebase onto main.
Thanks @jack-stormentswe! |
Fixes #76529.
Telegram preview finalization only forces a fresh final when the preview has been visible for 60s. When tool/block bubbles are delivered between preview creation and the final answer, editing the preview in place puts the final above the intermediate output (the user sees "Done" at the top, not the bottom).
Track the timestamp of the most recent visible non-preview delivery in the dispatcher and force fresh-final when that timestamp is newer than the active preview's
visibleSinceMs, regardless of preview age.Acceptance:
pnpm test extensions/telegram/src/bot-message-dispatch.test.ts— 108/108pnpm test extensions/telegram/src/lane-delivery.test.ts— 27/27pnpm tsgo:extensions:allcleanpnpm exec oxfmt --checkclean