Skip to content

fix(telegram): keep tool rows visible under progress preambles - #108394

Merged
obviyus merged 3 commits into
openclaw:mainfrom
keshavbotagent:fix/telegram-ephemeral-tool-progress
Jul 16, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
keshavbotagent:fix/telegram-ephemeral-tool-progress

Conversation

@keshavbotagent

Copy link
Copy Markdown
Contributor

Related: #106026

What Problem This Solves

Fixes an issue where Telegram users with streaming.mode: progress and verbose output off would see only the model's preamble in the ephemeral progress draft while tools were running. The rolling tool rows were masked until the draft collapsed and the permanent final reply arrived.

The first bad commit is 8d465d71b5f72450a1c71b21f6af6e7e99293759 (#106026). It made a model preamble the status headline, but Telegram's status-headline renderer discarded the accumulated line metadata. The shared compositor also deduplicated only on the unchanged headline text, so later tool rows stopped producing draft updates.

Why This Change Was Made

Telegram now opts into line-aware updates while a preamble is active and renders bounded structured work rows beneath that headline. Reasoning and commentary remain buffered behind the headline, the configured maxLines limit still owns the rolling window, and Discord/Mattermost retain their existing behavior because the new compositor capability is opt-in.

Both Telegram HTML previews and rich-message previews use the same filtered work-row set.

User Impact

A progress-mode Telegram turn now keeps one ephemeral draft showing the preamble plus the newest configured tool rows (for example, the latest 8 of 10 calls). The existing lifecycle is unchanged: the progress window collapses and the permanent final reply is delivered normally.

Evidence

  • Real pre-fix observation: on OpenClaw 2026.7.2, the Telegram client showed a preamble-only ephemeral draft for the reported turn. The corresponding raw Codex rollout contained the commentary preamble followed by all visible tool-start events, proving the events reached OpenClaw but were masked at draft composition/rendering.
  • First-bad source proof: fix(channels): progress drafts only for long tasks, with the model's own preamble as the status headline #106026 introduced both the status-headline-only Telegram branch and the text-only compositor dedupe. Its parent had no model-preamble headline path.
  • Codex contract proof at upstream Codex 87b808bb57: codex-rs/app-server-protocol/src/protocol/event_mapping.rs maps command starts to item/started, while protocol/v2/item.rs represents them as CommandExecution; OpenClaw's Codex projector normalizes those into stream: "tool" start/result events. This confirms the producer contract was intact.
  • Added a full callback-chain regression: 10 Codex-style tool starts flow through createAgentRunEventHandler, the real buffered reply dispatcher, and Telegram progress rendering with verbose off. It asserts the preamble plus only rows 3-10, permanent final delivery, and a 10-tool collapse summary.
  • Added shared compositor coverage for successive line changes under an unchanged preamble.
  • Updated both preamble orderings: preamble before tools and preamble after a tool start.

Validation:

  • node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts --reporter=dot — 212/212 passed.
  • node scripts/run-vitest.mjs src/channels/progress-draft-compositor.test.ts --reporter=dot — 29/29 passed.
  • Post-rebase focused Telegram + compositor regression run — 6/6 passed.
  • pnpm check — preflight, all TypeScript projects, lint, formatting, and policy guards passed.
  • Post-narrowing pnpm tsgo:core && pnpm tsgo:extensions && pnpm tsgo:test:root — passed.
  • The prescribed check-changed remote delegation did not start because the installed Crabbox binary failed its own version/help sanity check; no code check failed, and GitHub CI remains the remote gate.

Duplicate audit: no open issue or PR matches progress-mode preambles masking rolling tool rows. #93249 is related but different: it fixes in-flight answer preambles in partial streaming and explicitly excludes progress mode.

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S labels Jul 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ba7346f36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@keshavbotagent
keshavbotagent force-pushed the fix/telegram-ephemeral-tool-progress branch from 1ba7346 to c652941 Compare July 15, 2026 19:40
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M and removed size: S labels Jul 15, 2026
@keshavbotagent

Copy link
Copy Markdown
Contributor Author

@clawsweeper review
@codex review

@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: c652941008

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@obviyus obviyus self-assigned this Jul 16, 2026
@obviyus
obviyus force-pushed the fix/telegram-ephemeral-tool-progress branch from c652941 to ea7242b Compare July 16, 2026 04:50
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Jul 16, 2026
@obviyus
obviyus force-pushed the fix/telegram-ephemeral-tool-progress branch from ea7242b to 443cf7c Compare July 16, 2026 04:57
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Jul 16, 2026
@obviyus
obviyus merged commit 9f56093 into openclaw:main Jul 16, 2026
120 of 122 checks passed
@obviyus

obviyus commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Landed via squash onto main.

  • Scoped proof: Telegram progress rendering/update tests plus shared compositor tests — 75 passed
  • SDK API baseline generation/check: passed
  • GitHub CI: green
  • Changelog: release-owned; not updated
  • Source head: 443cf7c
  • Merge commit: 9f56093

Thanks @keshavbotagent!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 16, 2026
* fix(telegram): keep tool rows below progress preambles
* fix(telegram): preserve text tool progress under preambles
* fix(telegram): preserve memory progress under preambles

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
@keshavbotagent
keshavbotagent deleted the fix/telegram-ephemeral-tool-progress branch July 27, 2026 01:57
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* fix(telegram): keep tool rows below progress preambles
* fix(telegram): preserve text tool progress under preambles
* fix(telegram): preserve memory progress under preambles

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
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: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants