openclaw - ✅(Solved) Fix [Bug]: Telegram partial streaming surfaces excessive transient tool/exec progress bubbles in DM [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77072Fetched 2026-05-05 05:52:44
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
2
Timeline (top)
commented ×2cross-referenced ×2closed ×1labeled ×1

With channels.telegram.streaming.mode = "partial", Telegram DM sessions surfaced repeated transient Working… bubbles showing tool/exec progress, command text, and command output before the final answer.

Root Cause

With channels.telegram.streaming.mode = "partial", Telegram DM sessions surfaced repeated transient Working… bubbles showing tool/exec progress, command text, and command output before the final answer.

Fix Action

Fix / Workaround

Before the workaround, Telegram displayed repeated transient bubbles similar to:

A bounded diagnostic found this active Telegram config before the workaround:

The applied workaround changed only that setting, preserving the existing object shape:

PR fix notes

PR #77110: fix(telegram): drop raw exec output from preview progress on command items (#77072)

Description (problem / solution / changelog)

What

When a Telegram DM session runs under channels.telegram.streaming.mode = "partial" and the agent does tool-heavy work, the preview message gets repeatedly rewritten with transient bubbles full of internal command output, command text, file paths, and log fragments before the final answer arrives. The reporter showed this leaks /private/var/... paths, [context-engine] log lines, and other raw exec output, which makes a healthy tool-using agent look broken or noisy. I reproduced this locally with a Telegram bot in DM mode under streaming.mode = "partial", sent a tool-heavy prompt that triggered a series of exec calls, and confirmed the noise was as the reporter described.

Why

The Telegram dispatch path in extensions/telegram/src/bot-message-dispatch.ts forwards every onItemEvent payload into formatChannelProgressDraftLine more or less verbatim, including progressText. The agent layer at src/agents/pi-embedded-subscribe.handlers.tools.ts emits a separate kind: "command" item event for exec calls, and on that event progressText is set to the raw exec output (extractToolResultText(sanitized)), while the redacted, short command summary lives in title and meta. Inside formatChannelProgressDraftLine the meta detail of an item line resolves to meta ?? progressText ?? summary, so as soon as the agent layer emits an updated command item without meta populated, the formatter falls back to progressText, which is the raw output, and that becomes the preview bubble. Multiple updates per command create the flood.

This is a Telegram-owned routing problem, not a core formatter problem, since the formatter is doing what its precedence rules say and other channels can pick a different sanitization stance. Per the AGENTS.md owner-boundary rule, I kept the fix inside extensions/telegram and did not touch core, the formatter, or the SDK-side ChannelProgressDraftLineInput shape.

What I changed

  • extensions/telegram/src/bot-message-dispatch.ts: added a small private helper, exported under sanitizeItemEventForPreviewForTests so a unit test can exercise the pure logic. For kind: "command", the helper drops progressText and provides a clean meta fallback derived from payload.meta?.trim() first, then from title.replace(/^\s*command\s+/i, "").trim() second, then undefined. For every other item kind the helper passes the payload through unchanged.
  • extensions/telegram/src/bot-message-dispatch.test.ts: added a new describe("Telegram preview progress sanitization for command items (#77072)") block with 9 vitest cases.
  • CHANGELOG.md: one entry under Unreleased > Fixes crediting @EmpireCreator.

What did not change

  • No new config option, the existing channels.telegram.streaming.preview.toolProgress = false opt-out still works
  • Final answer delivery, error delivery, media payloads, approval payloads, plan updates, command-output completion lines, and patch summary lines flow through their existing paths
  • Core, src/plugin-sdk/channel-streaming.ts, the formatter, the AgentItemEventData shape, and the agent tool handler are all untouched
  • Discord, Slack, Matrix, and other channels that consume the same onItemEvent shape are unaffected

How I tested it

9 vitest cases in extensions/telegram/src/bot-message-dispatch.test.ts:

  1. drops raw progressText and uses meta for command-kind items (pure helper)
  2. derives clean meta from the command title when meta is missing (pure helper)
  3. falls back to undefined meta when neither meta nor a parseable title is present (pure helper)
  4. passes non-command item events through unchanged (pure helper, regression guard)
  5. suppresses raw exec command output from the partial preview when a command item event fires (dispatch end-to-end)
  6. renders the redacted command summary in the partial preview for a command item event (dispatch end-to-end)
  7. leaves non-command tool item events on the existing progressText path (dispatch end-to-end, regression guard)
  8. still routes the final assistant reply through unchanged when a command item event fires first (dispatch end-to-end, regression guard)
  9. keeps preview.toolProgress=false suppressing the preview entirely for command items (dispatch end-to-end, regression guard for the existing opt-out)

Manual reproduction: I configured a Telegram bot under channels.telegram.streaming.mode = "partial", sent a tool-heavy prompt that triggered a sequence of exec calls including find and search, and watched the preview message in DM. Before the patch, the preview message kept rewriting itself with transient bubbles containing raw stdout, file paths, and log fragments. After the patch, the preview shows the redacted command summary line and updates cleanly between commands, the final answer arrives unchanged, and the existing preview.toolProgress: false config still suppresses the preview entirely.

Validation

pnpm vitest run extensions/telegram/src/bot-message-dispatch.test.ts, 122 passed, 1 unrelated pre-existing failure on upstream/main.

AI / vibe-coding disclosure

  • AI-assisted with Claude Opus 4.7 (Anthropic). Marked per CONTRIBUTING.md.
  • 9 unit + integration tests added and hand-reviewed against the dispatch path.
  • I did not run pnpm check:changed or pnpm exec oxfmt --check from clawsweeper's acceptance criteria locally, will address Codex review feedback on the PR if it surfaces format or unrelated typecheck issues.
  • Will resolve clawsweeper / Codex review conversations as they come in.

Closes #77072. Thanks @EmpireCreator for the report.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/telegram/src/bot-message-dispatch.test.ts (modified, +177/-0)
  • extensions/telegram/src/bot-message-dispatch.ts (modified, +71/-8)

Code Example

{
   "channels": {
     "telegram": {
       "streaming": {
         "mode": "partial"
       }
     }
   }
 }

---

Working…
• command search "..." ...
• tool: exec
• exec search "..." ...
• raw command output preview ...
• exec ✓

---

Observed user-visible Telegram transient bubbles included the following redacted examples:


Working…
• command search "(lossless-claw|context-engine|registerContextEngine|plugin.*load|plugin.*discover)" ...
• tool: exec
• exec search "(lossless-claw|context-engine|registerContextEngine|plugin.*load|plugin.*discover)" ...
[context-engine] Context engine "lossless-claw" is not registered; falling back to default engine "legacy" ...
• exec ✓



Working…
• command find files named "*openclaw*" in /var -> show first 5 lines ...
• tool: exec
• exec find files named "*openclaw*" ...
/private/var/.../T/node-compile-cache/openclaw ...
• exec ✓


A bounded diagnostic found this active Telegram config before the workaround:


"streaming": {
  "mode": "partial"
}


The applied workaround changed only that setting, preserving the existing object shape:


 "streaming": {
-  "mode": "partial"
+  "mode": "off"
 }


After a gateway restart, the active config was verified as:


"streaming": {
  "mode": "off"
}


A harmless exec-based Telegram test then suppressed the transient `Working…` / `tool: exec` / raw progress bubbles.

Sensitive details redacted: Telegram user ID, local session key, local machine-specific temp paths beyond generic `/private/var/...`, and any irrelevant local account identifiers.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

With channels.telegram.streaming.mode = "partial", Telegram DM sessions surfaced repeated transient Working… bubbles showing tool/exec progress, command text, and command output before the final answer.

Steps to reproduce

  1. Start OpenClaw with Telegram enabled and this active config shape:
{
  "channels": {
    "telegram": {
      "streaming": {
        "mode": "partial"
      }
    }
  }
}
  1. In a Telegram DM with an OpenClaw agent, send a prompt that causes the agent to run tool-heavy diagnostic work, including harmless shell/exec commands.
  2. Observe Telegram while the agent is working, before the final answer is posted.
  3. Change only channels.telegram.streaming.mode from "partial" to "off", restart the gateway, and repeat a harmless exec-based test prompt.

Expected behavior

Telegram should not expose excessive internal tool/exec progress details, command text, or command output as repeated transient user-visible bubbles during normal agent execution.

Actual behavior

Before the workaround, Telegram displayed repeated transient bubbles similar to:

Working…
• command search "..." ...
• tool: exec
• exec search "..." ...
• raw command output preview ...
• exec ✓

The bubbles appeared and disappeared before the final answer, sometimes in groups of 10–20 messages during tool-heavy work.

After changing channels.telegram.streaming.mode from "partial" to "off" and restarting the gateway, the transient tool/exec progress bubbles were suppressed in the observed test.

OpenClaw version

2026.5.2

Operating system

macOS 26.4.1

Install method

npm global

Model

xai/grok-4.3

Provider / routing chain

xAI (primary) with configured fallbacks (Anthropic Opus 4.6, GPT 5.5)

Additional provider/model setup details

Primary model: xai/grok-4.3 via OpenClaw model registry. Fallbacks and auth profiles configured in openclaw.json.

Logs, screenshots, and evidence

Observed user-visible Telegram transient bubbles included the following redacted examples:


Working…
command search "(lossless-claw|context-engine|registerContextEngine|plugin.*load|plugin.*discover)" ...
• tool: exec
exec search "(lossless-claw|context-engine|registerContextEngine|plugin.*load|plugin.*discover)" ...
[context-engine] Context engine "lossless-claw" is not registered; falling back to default engine "legacy" ...
exec


Working…
command find files named "*openclaw*" in /var -> show first 5 lines ...
• tool: exec
exec find files named "*openclaw*" ...
• /private/var/.../T/node-compile-cache/openclaw ...
exec

A bounded diagnostic found this active Telegram config before the workaround:


"streaming": {
  "mode": "partial"
}


The applied workaround changed only that setting, preserving the existing object shape:


 "streaming": {
-  "mode": "partial"
+  "mode": "off"
 }


After a gateway restart, the active config was verified as:


"streaming": {
  "mode": "off"
}


A harmless exec-based Telegram test then suppressed the transient `Working…` / `tool: exec` / raw progress bubbles.

Sensitive details redacted: Telegram user ID, local session key, local machine-specific temp paths beyond generic `/private/var/...`, and any irrelevant local account identifiers.

Impact and severity

Affected users/systems/channels: Telegram DM users with channels.telegram.streaming.mode = "partial" during tool-heavy agent runs.

Severity: Annoying / confusing UX issue. It made a healthy tool-using agent appear broken, stuck, or excessively noisy.

Frequency: Intermittent, but frequent during observed tool-heavy diagnostic prompts.

Consequence: The user saw repeated transient internal-looking tool/exec progress bubbles before final answers and could reasonably mistake the agent for malfunctioning.

Additional information

Workaround observed: changing channels.telegram.streaming.mode from "partial" to "off" and restarting the gateway suppressed the transient Telegram tool/exec progress bubbles.

Regression status: Unknown (not tested against prior versions)

Last known good version: Not determined

First known bad version: 2026.5.2 (current observed version)

extent analysis

TL;DR

Setting channels.telegram.streaming.mode to "off" may resolve the issue of repeated transient Working… bubbles in Telegram DM sessions.

Guidance

  • The issue seems to be related to the channels.telegram.streaming.mode configuration, specifically when set to "partial".
  • To verify, try changing the mode to "off" and restart the gateway to see if the transient bubbles are suppressed.
  • If the issue persists, review the logs and Telegram configuration to ensure that the change was applied correctly.
  • Consider testing with different streaming.mode values to determine the optimal setting for your use case.

Example

No code snippet is provided as the issue is related to configuration settings.

Notes

The workaround was observed to be effective in suppressing the transient bubbles, but the root cause of the issue is not explicitly stated. Further investigation may be necessary to determine the underlying reason for the behavior.

Recommendation

Apply the workaround by setting channels.telegram.streaming.mode to "off" and restarting the gateway, as it has been observed to resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Telegram should not expose excessive internal tool/exec progress details, command text, or command output as repeated transient user-visible bubbles during normal agent execution.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Telegram partial streaming surfaces excessive transient tool/exec progress bubbles in DM [1 pull requests, 2 comments, 3 participants]