Skip to content

fix: suppress Telegram fallback after message-tool-only turns#90080

Closed
pfrederiksen wants to merge 1 commit into
openclaw:mainfrom
pfrederiksen:fix/issue-90076-message-tool-no-reply
Closed

fix: suppress Telegram fallback after message-tool-only turns#90080
pfrederiksen wants to merge 1 commit into
openclaw:mainfrom
pfrederiksen:fix/issue-90076-message-tool-no-reply

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 that exercises a message-tool-only group turn where final text is skipped/silent and verifies no extra Telegram fallback is sent.

Fixes #90076.

Before/After Proof

Before: extensions/telegram/src/bot-message-dispatch.ts treated any non-silent skipped/failed Telegram delivery lane payload as eligible for No response generated. Please try again., even when sourceReplyDeliveryMode was message_tool_only and the visible reply was expected to happen through the message tool.

After: the empty-response fallback path now respects the existing suppressSilentReplyFallback guard for message-tool-only turns, so skipped automatic final text does not create a second fallback reply.

Real Behavior Proof

Behavior addressed: Telegram group turns that send visible output through the message tool and finish with NO_REPLY no longer emit the empty-response fallback when the automatic Telegram final-delivery lane records a skipped non-silent payload.

Real environment tested: local OpenClaw source checkout on Linux, hydrated with pnpm install --frozen-lockfile, running the patched Telegram dispatch path from this branch.

Exact steps or command run after this patch: node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts

Evidence after fix: terminal capture from the patched OpenClaw checkout:

$ node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts
[test] starting test/vitest/vitest.extension-telegram.config.ts
RUN  v4.1.7 /root/.openclaw/workspace/openclaw-pr-90076
Test Files  1 passed (1)
Tests  104 passed (104)
[test] passed 1 Vitest shard in 24.43s

Observed result after fix: the new Telegram dispatch case keeps deliverReplies, editMessageTelegram, and sendMessageTelegram uncalled for the message-tool-only empty-response fallback path, so no No response generated. Please try again. fallback is emitted.

What was not tested: live Telegram API delivery; this change is covered at the Telegram dispatch level in a local OpenClaw checkout.

Verification

  • pnpm install --frozen-lockfile
  • node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts
  • git diff --check

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 4, 2026
@clawsweeper

clawsweeper Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 3, 2026, 8:57 PM ET / 00:57 UTC.

Summary
The PR adds a message_tool_only guard to Telegram’s empty-response fallback path and adds a regression for skipped final-text delivery after message-tool-only turns.

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

Reproducibility: yes. from source inspection: current main can mark a non-silent skipped automatic final payload, return sourceReplyDeliveryMode: "message_tool_only", and still satisfy the empty-response fallback condition. I did not run a live Telegram reproduction in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P2] Add redacted live Telegram proof, such as a transcript, recording, terminal/live output, or logs showing the message-tool-only group turn does not emit the generic fallback.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body supplies terminal output for a focused Vitest regression, but no live Telegram run, transcript, recording, or redacted logs showing the after-fix Telegram behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A live Telegram transcript would directly prove that the message-tool reply appears without the duplicate empty-response fallback. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

telegram live proof: verify a Telegram group message-tool-only NO_REPLY turn sends only the message-tool reply and no generic empty-response fallback.

Risk before merge

  • [P2] The supplied proof is dispatch-level Vitest output, not a live Telegram group turn showing the message-tool reply with no extra fallback message.
  • [P2] The guard changes Telegram fallback behavior for both non-silent skipped and failed delivery-lane payloads under message_tool_only, so live transport proof should confirm it suppresses only the duplicate fallback and does not hide a real visible-delivery failure.

Maintainer options:

  1. Require Live Telegram Proof (recommended)
    Ask for redacted live Telegram proof showing a group message-tool-only NO_REPLY turn emits the intended message-tool reply and no generic fallback.
  2. Accept Dispatch-Level Proof
    Maintainers may choose to accept the focused regression as sufficient for this narrow fallback path, with the live Telegram gap documented.

Next step before merge

  • [P1] No mechanical code repair is identified; the remaining blocker is maintainer review of the message-delivery risk plus contributor or Mantis live Telegram proof.

Security
Cleared: The diff only changes Telegram dispatch logic and a colocated regression test; it does not touch dependencies, secrets, CI, packaging, or other supply-chain surfaces.

Review details

Best possible solution:

Land the narrow Telegram fallback guard after live Telegram proof or maintainer acceptance confirms a message-tool-only group turn sends only the intended message-tool reply and no generic fallback.

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

Yes from source inspection: current main can mark a non-silent skipped automatic final payload, return sourceReplyDeliveryMode: "message_tool_only", and still satisfy the empty-response fallback condition. I did not run a live Telegram reproduction in this read-only review.

Is this the best way to solve the issue?

Yes, the proposed fix is the best small owner-boundary fix: Telegram already tracks message_tool_only as automatic-source-delivery suppression, and the fallback check is the point that currently ignores that state. The remaining gap is live Telegram proof, not a different code shape.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a normal-priority Telegram delivery bug fix with visible user impact but limited blast radius.
  • add merge-risk: 🚨 message-delivery: The diff changes when Telegram sends or suppresses the generic empty-response fallback after message-tool-only turns.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body supplies terminal output for a focused Vitest regression, but no live Telegram run, transcript, recording, or redacted logs showing the after-fix Telegram behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes user-visible Telegram chat behavior by suppressing an extra fallback message after message-tool-only delivery.

Label justifications:

  • P2: This is a normal-priority Telegram delivery bug fix with visible user impact but limited blast radius.
  • merge-risk: 🚨 message-delivery: The diff changes when Telegram sends or suppresses the generic empty-response fallback after message-tool-only turns.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body supplies terminal output for a focused Vitest regression, but no live Telegram run, transcript, recording, or redacted logs showing the after-fix Telegram behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes user-visible Telegram chat behavior by suppressing an extra fallback message after message-tool-only delivery.
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:

  • Current fallback path: Current main sends the generic empty-response fallback for non-room-event turns when no Telegram delivery was recorded and the delivery lane has a non-silent skip or failure; the PR adds the existing message_tool_only suppression guard to this condition. (extensions/telegram/src/bot-message-dispatch.ts:2208, 392af2e61201)
  • Existing message-tool-only suppression: The Telegram dispatcher already records suppressSilentReplyFallback when the dispatch result reports sourceReplyDeliveryMode === "message_tool_only", and later treats that mode as a final-response condition. (extensions/telegram/src/bot-message-dispatch.ts:2139, 392af2e61201)
  • Source-reply contract: Core reply policy defines message_tool_only as suppressing automatic source delivery, which makes the Telegram fallback guard an owner-boundary-aligned fix rather than a new delivery mode. (src/auto-reply/reply/source-reply-delivery-mode.ts:133, 392af2e61201)
  • Automatic delivery suppression behavior: When source delivery is suppressed, dispatch-from-config skips ordinary final replies and returns sourceReplyDeliveryMode: "message_tool_only", so Telegram can distinguish intentional message-tool delivery from an empty response. (src/auto-reply/reply/dispatch-from-config.ts:2831, 392af2e61201)
  • PR regression coverage: The PR adds a Telegram dispatch regression that simulates a silent final skip plus a cancelled automatic final payload under message_tool_only and asserts no fallback delivery/edit/send methods are called. (extensions/telegram/src/bot-message-dispatch.test.ts:2776, 33eafa396f6d)
  • Telegram review proof policy: The Telegram maintainer note requires real Telegram proof for Telegram behavior PRs that touch transport or visible reply behavior, so the supplied dispatch-level test output is useful but not sufficient proof by itself. (.agents/maintainer-notes/telegram.md:37, 392af2e61201)

Likely related people:

  • steipete: Blame ties the current Telegram fallback block and message_tool_only suppression variable to commit 190fd03, which introduced the current dispatch file shape in this checkout. (role: recent area contributor; confidence: medium; commits: 190fd034d59c; files: extensions/telegram/src/bot-message-dispatch.ts)
  • vincentkoc: Recent history on the same Telegram dispatch and auto-reply surfaces includes plugin SDK baseline, Telegram media loader injection, and Telegram dispatch test work. (role: adjacent Telegram/runtime contributor; confidence: medium; commits: 2e08f0f4221f, 6eafa2ec87ad, 334085fbe98a; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/bot-message-dispatch.test.ts, src/auto-reply/reply/dispatch-from-config.ts)
  • Ayaan Zaidi: Recent commits in the same Telegram delivery/reply history address abort supersede and compaction replay boundaries near this fallback behavior. (role: adjacent Telegram delivery contributor; confidence: medium; commits: dc3b10285db8, 5aad79571ee6; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/bot-message-dispatch.test.ts)
  • rubencu: Recent linked Telegram delivery fixes in the same history cover stale reply delivery and transient preview behavior, making this person a useful routing candidate for Telegram fallback review. (role: adjacent Telegram delivery contributor; confidence: medium; commits: 996eb9a024d0, c65f356ddc95; files: extensions/telegram/src/bot-message-dispatch.ts, extensions/telegram/src/bot-message-dispatch.test.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.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. 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. 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

Copy link
Copy Markdown
Contributor Author

Closing at the reporter's request.

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: supplied External PR includes structured after-fix real behavior proof. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram message-tool NO_REPLY turns can emit empty-response fallback

1 participant