Skip to content

fix(telegram): force fresh final after visible intermediate output (#76529)#76725

Merged
steipete merged 2 commits into
openclaw:mainfrom
davidv399:fix/telegram-final-after-visible-intermediate
May 3, 2026
Merged

fix(telegram): force fresh final after visible intermediate output (#76529)#76725
steipete merged 2 commits into
openclaw:mainfrom
davidv399:fix/telegram-final-after-visible-intermediate

Conversation

@davidv399

Copy link
Copy Markdown
Contributor

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/108
  • pnpm test extensions/telegram/src/lane-delivery.test.ts — 27/27
  • pnpm tsgo:extensions:all clean
  • pnpm exec oxfmt --check clean

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S labels May 3, 2026
@davidv399

Copy link
Copy Markdown
Contributor Author

Hi @civiltox @clawsweeper — picked this up. Would appreciate a look when you have time.

@clawsweeper

clawsweeper Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The branch records the last visible non-preview Telegram delivery, uses it to force fresh final sends after an active preview, and updates Telegram tests, docs, and changelog text.

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
No repair lane is needed because there is no concrete remaining defect in the PR diff; normal CI and maintainer review can handle merge readiness.

Security
Cleared: The diff is limited to Telegram delivery logic, tests, docs, and changelog text, with no dependency, workflow, secret, package, or external code execution changes.

Review details

Best 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:

  • steipete: Blame for the current lane text deliverer and recent Telegram docs history point to Peter Steinberger as the main maintainer adjacent to preview finalization and delivery behavior. (role: recent Telegram channel maintainer; confidence: high; commits: 63ff9244c711, e2c8db2cad40; files: extensions/telegram/src/lane-delivery-text-deliverer.ts, docs/channels/telegram.md)
  • thats2easyyy: Commit history for bot-message-dispatch.ts shows recent adjacent Telegram dispatch maintenance in the same delivery pipeline. (role: recent adjacent maintainer; confidence: medium; commits: 796c1e67c3d9; files: extensions/telegram/src/bot-message-dispatch.ts)
  • GodsBoy: Recent history for docs/channels/telegram.md includes Telegram streaming documentation work near the PR's docs surface. (role: recent Telegram docs maintainer; confidence: medium; commits: b336efdd9cfd; files: docs/channels/telegram.md)

Remaining risk / open question:

  • Exact-head CI results were not available in the supplied context, so normal required checks should still gate merge.

Codex review notes: model gpt-5.5, reasoning high; reviewed against e2c8db2cad40.

@davidv399
davidv399 force-pushed the fix/telegram-final-after-visible-intermediate branch 2 times, most recently from 7545733 to b11177d Compare May 3, 2026 14:37
@davidv399

Copy link
Copy Markdown
Contributor Author

Hi @steipete
The branch conflict has been resolved and the PR is now mergeable against main

@davidv399
davidv399 marked this pull request as draft May 3, 2026 14:39
@davidv399
davidv399 marked this pull request as ready for review May 3, 2026 14:40
@steipete
steipete force-pushed the fix/telegram-final-after-visible-intermediate branch from b11177d to b5a61cd Compare May 3, 2026 15:24
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label May 3, 2026
@davidv399

Copy link
Copy Markdown
Contributor Author

Hi @steipete
All CI Tests passed. ❤️ Ready to merge now.

@steipete
steipete merged commit 6becfcb into openclaw:main May 3, 2026
104 checks passed
@steipete

steipete commented May 3, 2026

Copy link
Copy Markdown
Contributor

Landed via rebase onto main.

  • Local proof: pnpm test extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/lane-delivery.test.ts (136 passed)
  • Format proof: pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/channels/telegram.md extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.ts extensions/telegram/src/lane-delivery-text-deliverer.ts
  • Source PR head: b5a61cd
  • Landed commits: 2b38345 and 6becfcb

Thanks @jack-stormentswe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram: Assistant reply fragments appear out of order when streamed across multiple tool calls

2 participants