fix(telegram): suppress failure fallback when source delivery is message-tool-only#90114
fix(telegram): suppress failure fallback when source delivery is message-tool-only#90114openperf wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 7:37 AM ET / 11:37 UTC. Summary PR surface: Source +1, Tests +34. Total +35 across 2 files. Reproducibility: yes. at source level. Current main still evaluates the skipped/failed empty-response fallback without Review metrics: 2 noteworthy metrics.
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:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical Telegram guard-and-regression implementation, then close the duplicate PR and the linked issue after the fix merges. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main still evaluates the skipped/failed empty-response fallback without Is this the best way to solve the issue? Yes for the code shape. Applying the existing message-tool-only guard at the Telegram fallback decision is the narrow owner-boundary fix, but maintainers still need to choose the canonical PR. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d1cbe29f3d52. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +34. Total +35 across 2 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
|
13f814d to
1e11890
Compare
1e11890 to
8cb330d
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for fixing the silent-reply fallback. I’m closing this as a duplicate of #90095: both branches add the same runtime guard, while #90095 is tied directly to the reporter’s reproduction and carries the stronger regression/proof record. The underlying bug is still present on current main, so #90091 should remain open until #90095 is refreshed and landed. |
Summary
message_tool_onlysource delivery still emit a spurious"No response generated. Please try again."fallback message after the agent already delivered the visible reply via themessagetool.shouldSendFailureFallbackinbot-message-dispatch.tsis gated on!isRoomEventbut not on!suppressSilentReplyFallback.suppressSilentReplyFallbackis set totruewhendispatchResult.sourceReplyDeliveryMode === "message_tool_only"— butdispatch-from-config.tscan resolvesourceReplyDeliveryModeto"message_tool_only"via config (e.g.visibleReplies === "message_tool") even foruser_requestevents whereisRoomEvent = false. When the message tool delivers the visible reply and the main reply lane is skipped with reason"empty"(skippedNonSilent = 1), the failure fallback fires.!suppressSilentReplyFallbackto theshouldSendFailureFallbackcondition. The sibling silent-fallback branch at the same site already carries this guard; this aligns the failure-fallback branch with the same invariant.bot-message-dispatch.ts— one-line guard addition;bot-message-dispatch.test.ts— one regression test covering the non-room-event group turn with non-silent skip +message_tool_onlydispatch result.Reproduction
visibleReplies: "message_tool"(or equivalent global/agent-level policy)user_requestevent (e.g. mention the bot)message(action="send")and returnsNO_REPLYas the final text"empty"(skippedNonSilent = 1)"No response generated. Please try again."as a delivery-mirror fallback, even though the agent already replied via message toolReal behavior proof
Behavior addressed (#90091): after a
message_tool_onlyturn where the message tool delivered the visible reply, Telegram no longer emits a spurious"No response generated. Please try again."fallback from the failure-fallback branchReal environment tested (source inspection; no live Telegram replay performed):
dispatch-from-config.tsconfirmed to resolvesourceReplyDeliveryMode === "message_tool_only"independently ofisRoomEventwhenvisibleReplies === "message_tool"via config;bot-message-dispatch.tsconfirmed to setsuppressSilentReplyFallback = truefrom that dispatch result while leavingisRoomEvent = false; reporter's session transcript (2026-06-04T00:07:02.309Zdelivery-mirror messages) provided live evidence of the failureExact steps or command run after this patch:
node scripts/run-vitest.mjs extensions/telegram/src/bot-message-dispatch.test.ts;git diff --check;node scripts/run-oxlint.mjs extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.tsEvidence after fix (Vitest output for the touched test file):
The new test
does not send failure fallback when source delivery is message-tool-only and reply lane is non-silently skippedcallsdispatcherOptions.onSkipwithreason: "empty"(settingskippedNonSilent = 1) and returnssourceReplyDeliveryMode: "message_tool_only", then assertsdeliverRepliesis not called. Without the fix the test fails becauseshouldSendFailureFallbackevaluates totrue.Observed result after fix:
deliverRepliesnot called whensuppressSilentReplyFallback = trueregardless ofisRoomEvent; the failure-fallback branch is now aligned with the sibling silent-fallback branch which already carried this guardWhat was not tested: live Telegram group replay with a configured
visibleReplies: "message_tool"policy end-to-end; reporter's session transcript confirmed the source pathRisk / Mitigation
message_tool_onlyturn where the message tool itself also failed. Mitigation:suppressSilentReplyFallbackis onlytruewhen the dispatch result reportsmessage_tool_only— meaning the dispatch layer decided the turn was handled by the message tool; the sibling silent-fallback branch carries the same guard with the same invariant.message_tool_onlyturn where delivery genuinely failed could silently swallow the error. Mitigation:dispatchErrorstill fires the fallback unconditionally beforesuppressSilentReplyFallbackis evaluated; only the non-error skipped/failed delivery-summary path is suppressed.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Fixes #90091