fix(telegram): suppress fallback reply when plugin command returns suppressReply: true - #80928
Conversation
|
Codex review: found issues before merge. Reviewed June 30, 2026, 8:18 PM ET / 00:18 UTC. Summary PR surface: Source +28, Tests +11, Docs 0. Total +39 across 4 files. Reproducibility: yes. at source level. Current main normalizes undefined command results to Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Choose the permanent suppression contract, refresh the branch against current main, and land the Telegram fallback fix with matching SDK/channel semantics, docs, and regression coverage. Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main normalizes undefined command results to Is this the best way to solve the issue? Unclear as submitted. The Telegram early return fixes the symptom, but adding Telegram-only semantics to the public Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5e572dcf781a. Label changesLabel justifications:
Evidence reviewedPR surface: Source +28, Tests +11, Docs 0. Total +39 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
c0782ef to
eb3bf1a
Compare
Updates addressing ClawSweeper reviewThe initial ClawSweeper review flagged two P3 items:
Regarding the live Telegram proof request: this is a pure SDK API addition ( If a maintainer is satisfied with the test coverage and the documented API contract, could you please comment Re-review progress:
|
|
@openclaw-mantis verify this PR with native Telegram Desktop proof. Please show the plugin-command path where the command sends its own Telegram response directly: on main the bad fallback |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence for the Telegram command fallback behavior.
Motion-trimmed clips: Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-80928/run-27109011676-1/index.json |
|
Heads up: this PR needs to be updated against current |
1dd7d53 to
7a94e48
Compare
|
@clawsweeper re-review This PR has been rebased against current to satisfy the Dependency Guard check, and the ClawSweeper P3 SDK docs feedback has been addressed:
CI is green with no failing checks. Ready for another pass. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review This PR has been rebased against current main to satisfy the Dependency Guard check, and the ClawSweeper P3 SDK docs feedback has been addressed:
CI is green with no failing checks. Ready for another pass. |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
d0fb6b2 to
e6adb82
Compare
…ppressReply: true Adds to the type so plugin commands that handle their own transport delivery (e.g. via Telegram Bot API directly with retry logic, IPv4 forcing, etc.) can signal the channel adapter to skip the fallback reply. When a plugin command handler returns , the Telegram native command dispatcher now: 1. Cleans up any progress placeholder 2. Returns early without sending the "No response generated. Please try again." fallback Includes detailed JSDoc for the new flag explaining its use for plugin commands that deliver their own responses via channel-native APIs. Fixes openclaw#80756
…ion test ClawSweeper review flagged that the new suppressReply test replaced the existing direct-message binding regression test instead of being added beside it. Restore the DM binding test to maintain coverage for the plugin command dispatch surface.
e6adb82 to
1ec0b29
Compare
|
Landed via rebase onto main.
Thanks @alexuser! |
|
Rebased onto current
The Telegram and Discord behavior changes, plus the existing tests, were already merged upstream in #99647 and related commits, so those have been removed from this branch to avoid redundancy. ClawSweeper's concern about the SDK contract shape is now addressed: the flag is documented as a cross-channel signal (not Telegram-only), and the new helper type makes the contract explicit for plugin authors. |
Summary
Plugin commands registered via
api.registerCommandthat send responses directly via Telegram Bot API (with custom retry logic, IPv4 forcing, etc.) currently trigger a spurious "No response generated. Please try again." fallback message from the Telegram channel adapter. This happens because the adapter'shasRenderableTelegramNativeReplyPayloadcheck only looks fortext/mediaUrlcontent, and when the handler returnsundefinedor{}after doing its own delivery, no content is found so the fallback fires.This PR adds
suppressReply?: booleantoPluginCommandResultso handlers can explicitly signal "I already took care of delivery — don't send a fallback."Changes
src/plugins/types.ts: AddsuppressReply?: booleantoPluginCommandResultwith detailed JSDoc explaining when and why plugin authors should use it (for commands that deliver via channel-native APIs with custom transport guarantees)extensions/telegram/src/bot-native-commands.ts: AddisSuppressedTelegramNativeReplyPayloadcheck before the fallback path; clean up progress placeholder and return early when suppressedextensions/telegram/src/bot-native-commands.test.ts: Regression test ensuring{ suppressReply: true }produces nodeliverRepliesoreditMessageTelegramcallsFixes #80756
Real Behavior Proof
Behavior or issue addressed: Plugin commands that own their own transport delivery via Telegram Bot API produce a spurious "No response generated. Please try again." fallback because the handler returns no content and the adapter cannot distinguish "handled externally" from "no response".
Real environment tested: macOS 15.4, Node v26.0.0, local OpenClaw checkout on branch fix/80756-suppress-plugin-command-reply.
Exact steps or command run after this patch:
suppressReply?: booleantoPluginCommandResulttype insrc/plugins/types.tswith JSDoc documenting the flagisSuppressedTelegramNativeReplyPayloadhelper and early-return guard inextensions/telegram/src/bot-native-commands.tsextensions/telegram/src/bot-native-commands.test.tsEvidence after fix: Terminal output from running the Telegram bot-native-commands test suite locally:
All 19 tests passed, including the new regression test for
suppressReply: true.Observed result after fix:
{ suppressReply: true }no longer trigger the EMPTY_RESPONSE_FALLBACK path in Telegram native commands.{ text: "..." },{}, orundefinedis unchanged.eb3bf1a0pushed tofix/80756-suppress-plugin-command-replywith the JSDoc update addressing the ClawSweeper P3 finding.What was not tested: No live Telegram Bot API integration or actual message delivery was exercised; only the unit test harness behavior was validated. The fix is a pure TypeScript type + control-flow change with no runtime dependency on external APIs.
Maintainer notes
ClawSweeper review flagged the need for live Telegram proof. This change is a pure SDK API addition + Telegram adapter control-flow fix. The regression test covers the exact code path. If a maintainer believes the test coverage is sufficient, applying
@clawsweeper re-reviewor theproof: overridelabel would allow this to proceed.