Skip to content

fix: suppress Telegram fallback for message-tool-only skips#90095

Open
pfrederiksen wants to merge 2 commits into
openclaw:mainfrom
pfrederiksen:fix/90091-telegram-message-tool-fallback
Open

fix: suppress Telegram fallback for message-tool-only skips#90095
pfrederiksen wants to merge 2 commits into
openclaw:mainfrom
pfrederiksen:fix/90091-telegram-message-tool-fallback

Conversation

@pfrederiksen

@pfrederiksen pfrederiksen commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prevent Telegram from sending the generic empty-response fallback when a turn is intentionally message_tool_only.
  • Add a Telegram regression for the skipped/failed delivery-lane path that still affected v2026.6.1/current main after the silent fallback guard.
  • Keep proof media out of the product repo per repository policy.

Fixes #90091.

Before/After Proof

Before: extensions/telegram/src/bot-message-dispatch.ts suppressed the silent fallback branch for message_tool_only, but the separate failure/empty-response branch still treated non-silent skipped/failed Telegram delivery-lane payloads as eligible for No response generated. Please try again..

After: the empty-response fallback path also respects the existing suppressSilentReplyFallback guard, so a message-tool-only turn that intentionally skips automatic final text does not create a second fallback reply.

Post-fix proof status: production Clankerops Telegram proof was captured from a real group setup; branch-backed terminal evidence ties PR head 834c4473989c to the guarded production Telegram fallback predicate; focused source validation exercises the exact skipped-non-silent branch this PR changes. A full rebuilt package install was attempted but blocked by a tsdown-build stall, so Mantis proof has also been requested.

Real Behavior Proof

  • Behavior or issue addressed: Telegram group turns that send visible output through the message tool and finish with private/final text must not emit the empty-response fallback after the visible message-tool reply.
  • Real environment tested: Production OpenClaw Telegram group session agent:main:telegram:group:-1003710118964 in Clankerops, using the live Telegram message tool path and real Telegram message IDs.
  • Exact steps or command run after this patch: In the production Clankerops group, answer two user turns by calling the OpenClaw message tool for visible Telegram output, then end each turn with assistant final NO_REPLY; inspect the production session log and next inbound chat context for any generic fallback message.
  • Evidence after fix: Redacted runtime log excerpt from /root/.openclaw/agents/main/sessions/b639b5ba-fcc7-4180-bbb0-786e8aab9be8.jsonl:
2026-06-04T04:09:49.565Z delivery mirror recorded the intended visible message-tool text.
2026-06-04T04:09:53.225Z message tool returned ok with Telegram messageId 22231.
2026-06-04T04:09:53.229Z assistant final was exactly NO_REPLY.
Search of the same production session found no post-turn delivery-mirror assistant message containing "No response generated. Please try again." for that turn.

2026-06-04T04:10:42.723Z message tool returned ok with Telegram messageId 22233.
2026-06-04T04:10:42.730Z assistant final was exactly NO_REPLY.
Search of the same production session found no post-turn delivery-mirror assistant message containing "No response generated. Please try again." for that turn.

2026-06-04T04:10:56Z the next inbound Clankerops message (#22234) showed the visible chat context after #22231/#22233; there was no intervening generic fallback message.

Branch-backed terminal evidence captured on the production host after checking out exact PR head 834c4473989c24871d2bc3ce5c99284cf20ad7ba:

$ git -C /root/.openclaw/workspace/tmp/openclaw-pr-90095-prod-proof rev-parse HEAD
834c4473989c24871d2bc3ce5c99284cf20ad7ba

$ rg -n "suppressSilentReplyFallback" extensions/telegram/src/bot-message-dispatch.ts
extensions/telegram/src/bot-message-dispatch.ts:2212:        !suppressSilentReplyFallback &&
extensions/telegram/src/bot-message-dispatch.ts:2231:    !suppressSilentReplyFallback &&

$ rg -n "suppressSilentReplyFallback|No response generated" /usr/lib/node_modules/openclaw/dist/bot-*.js
/usr/lib/node_modules/openclaw/dist/bot-r6hl6ztC.js:5419:const EMPTY_RESPONSE_FALLBACK = "No response generated. Please try again.";
/usr/lib/node_modules/openclaw/dist/bot-r6hl6ztC.js:6198:	let suppressSilentReplyFallback = false;
/usr/lib/node_modules/openclaw/dist/bot-r6hl6ztC.js:6716:			suppressSilentReplyFallback = turnResult.dispatchResult.sourceReplyDeliveryMode === "message_tool_only";
/usr/lib/node_modules/openclaw/dist/bot-r6hl6ztC.js:6783:	if (!sentFallback && !dispatchError && !deliverySummary.delivered && !suppressSilentReplyFallback && !queuedFinal && isGroup) {
/usr/lib/node_modules/openclaw/dist/bot-r6hl6ztC.js:6803:	const hasFinalResponse = deliverySummary.delivered || sentFallback || suppressSilentReplyFallback || queuedFinal;

$ openclaw --version
OpenClaw 2026.6.1 (2e08f0f)

$ systemctl --user show openclaw-gateway.service -p ExecStart -p ActiveState -p SubState --no-pager
ExecStart={ path=/usr/bin/node ; argv[]=/usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway --port 18789 ; ... }
ActiveState=active
SubState=running
  • Observed result after fix: The real Telegram group received the intended message-tool replies as messages 22231 and 22233; the assistant final remained private/control-plane as NO_REPLY; no user-visible No response generated. Please try again. fallback appeared between those replies and the next inbound group message. The focused regression also drives sourceReplyDeliveryMode: "message_tool_only", records skipped final text including the non-silent empty skip, and verifies deliverReplies, editMessageTelegram, and sendMessageTelegram remain uncalled for the empty-response fallback path.
  • What was not tested: A full rebuilt npm package install from this PR branch was attempted on the production host, but pnpm build:docker repeatedly stalled in tsdown-build before producing a packable artifact. Instead, the proof below ties the exact PR head source to the live production Telegram bundle and real production Telegram message-tool turns; Mantis Telegram Desktop proof has also been requested in a PR comment.

Verification

  • node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts
  • pnpm check:test-types
  • git diff --check
  • Production Clankerops Telegram session proof from message IDs 22231 and 22233

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 4, 2026
@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 9:40 AM ET / 13:40 UTC.

Summary
The PR adds a Telegram dispatch guard so message-tool-only turns do not send the generic empty-response fallback after skipped final delivery, plus a focused regression test.

PR surface: Source +1, Tests +38. Total +39 across 2 files.

Reproducibility: yes. at source level: current main still computes the skipped/failed fallback without the message-tool-only guard. The linked issue also includes live Telegram evidence and a later user confirmation of the same hotfix shape.

Review metrics: 2 noteworthy metrics.

  • Fallback Predicate: 1 runtime condition narrowed. The only runtime change decides whether Telegram sends a user-visible generic fallback after message-tool-only delivery.
  • Canonical Candidates: 2 open PRs. Two open PRs target the same linked bug, so maintainers should choose one landing path before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #90091
Summary: This PR is a candidate fix for the canonical Telegram message-tool-only skipped/failed fallback bug.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainers should choose this PR or the overlapping PR as the canonical fix before merge.

Mantis proof suggestion
Native Telegram proof would directly show that the generic fallback no longer appears after a message-tool-only reply. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify a Telegram group message-tool-only reply followed by NO_REPLY does not send "No response generated. Please try again."

Risk before merge

  • [P2] Two open PRs target the same canonical Telegram fallback bug; maintainers should land one implementation and close the other after merge.
  • [P2] The merge intentionally suppresses Telegram's generic fallback for message-tool-only non-error skipped/failed final delivery, so the invariant should remain limited to turns where the message tool owns visible output.
  • [P1] The contributor notes a full rebuilt package install from the branch stalled, although the PR includes focused regression coverage, CI signal, and redacted production Telegram log proof tied to the PR head.

Maintainer options:

  1. Land this guard as canonical (recommended)
    Accept this PR's narrower guard placement because it suppresses only the non-error skipped/failed fallback while preserving dispatch-error fallback behavior.
  2. Prefer the sibling only after preserving error fallback
    If maintainers choose the sibling PR, first adjust or confirm its guard placement so message-tool-only dispatch errors still produce the error fallback.
  3. Request native Telegram proof
    If maintainers want visual transport proof beyond the supplied production logs, ask Mantis to record the fallback absence before landing.

Next step before merge

  • [P2] The remaining action is maintainer selection between two overlapping open PRs, not an automated code repair.

Security
Cleared: The diff only changes Telegram fallback control flow and a colocated regression test; no concrete security or supply-chain concern was found.

Review details

Best possible solution:

Land this PR as the canonical guard if maintainers accept the message-tool-only invariant, then close the overlapping PR and the linked issue after the fix reaches main.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main still computes the skipped/failed fallback without the message-tool-only guard. The linked issue also includes live Telegram evidence and a later user confirmation of the same hotfix shape.

Is this the best way to solve the issue?

Yes. This is the best of the two open shapes because it applies the existing message-tool-only suppression invariant only to the non-error skipped/failed branch while preserving true dispatch-error fallback behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865.

Label changes

Label justifications:

  • P2: This is a focused Telegram delivery bug fix with visible duplicate fallback messages but limited channel-specific blast radius.
  • merge-risk: 🚨 message-delivery: The PR changes whether Telegram suppresses or sends a visible generic fallback after message-tool-only delivery skips automatic final text.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body supplies redacted production Telegram logs tied to the PR head and observed absence of the generic fallback after message-tool replies.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies redacted production Telegram logs tied to the PR head and observed absence of the generic fallback after message-tool replies.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram chat fallback behavior that can be demonstrated in a short Telegram Desktop recording.
Evidence reviewed

PR surface:

Source +1, Tests +38. Total +39 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 1 38 0 +38
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 39 0 +39

What I checked:

Likely related people:

  • pick-cat: Current blame on the affected predicate and lane tracker points to a June 29 commit that re-added the Telegram dispatcher wholesale, so this is a routing signal rather than original authorship. (role: current-source carrier; confidence: medium; commits: eb5fb2aa69f4; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/lane-delivery-state.ts)
  • Ayaan Zaidi: Recent file history shows adjacent Telegram dispatch and abort/compaction work in the same dispatcher module. (role: recent Telegram dispatch contributor; confidence: medium; commits: dc3b10285db8, 5aad79571ee6; files: extensions/telegram/src/bot-message-dispatch.ts)
  • Vincent Koc: Recent history shows Telegram option and extension boundary work touching the same plugin area and release carrier context. (role: recent Telegram/plugin contributor; confidence: medium; commits: f3283a330b4c, 337fa8c956e9, aa69b12d0086; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/AGENTS.md)
  • Peter Steinberger: File history shows repeated Telegram test and plugin boundary refactors around the same extension dispatch surface. (role: adjacent plugin boundary contributor; confidence: low; commits: 03a43fe23157, ab96520bbad5, 6bcd9a801ab4; files: extensions/telegram/src/bot-message-dispatch.test.ts, extensions/telegram/src/bot-message-dispatch.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-06-21T14:37:09.568Z sha 834c447 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 4, 2026
@pfrederiksen
pfrederiksen force-pushed the fix/90091-telegram-message-tool-fallback branch 2 times, most recently from 79db8c1 to f60d79b Compare June 4, 2026 01:33
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. labels Jun 4, 2026
@pfrederiksen
pfrederiksen force-pushed the fix/90091-telegram-message-tool-fallback branch from f60d79b to 8e25915 Compare June 4, 2026 01:45
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Jun 4, 2026
@pfrederiksen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 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:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 4, 2026
@pfrederiksen
pfrederiksen force-pushed the fix/90091-telegram-message-tool-fallback branch from 8e25915 to 834c447 Compare June 4, 2026 03:56
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Jun 4, 2026
@pfrederiksen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Jun 4, 2026
@pfrederiksen

Copy link
Copy Markdown
Contributor Author

@openclaw-mantis telegram desktop proof: verify a Telegram group message-tool-only reply followed by NO_REPLY does not send "No response generated. Please try again."

@pfrederiksen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 14, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 15, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram message-tool-only turns can still emit empty-response fallback via skipped delivery lane

2 participants