Repository navigation
fix(telegram): ignore commands addressed to other bots - #118024
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 11:29 AM ET / 15:29 UTC. ClawSweeper reviewWhat this changesStops a Telegram group message whose leading command targets a different bot from being treated as an OpenClaw user request, while preserving commands targeting this bot. Merge readinessKeep this PR open for normal maintainer review. Current main has no foreign-bot command guard at the Telegram inbound-body boundary, and this branch adds a narrow early drop with focused regression coverage; its MEMBER authorship and Priority: P1 Review scores
Verification
How this fits togetherTelegram updates enter the Telegram plugin's message-context builder, which resolves message text, mention and command authorization, history, and eventual agent dispatch. This change inserts a foreign-command decision before those later stages so another bot's command produces an intentional no-op. flowchart TD
A[Telegram group update] --> B[Text and entity extraction]
B --> C[Inbound body resolution]
C --> D{Leading command targets this bot?}
D -->|Another bot| E[Record inbound drop and stop]
D -->|This bot or normal text| F[Authorization and mention policy]
F --> G[Context, history, and agent dispatch]
Decision needed
Why: The change intentionally discards an inbound update, and the protected maintainer workflow requires a human to accept the final behavior and validation evidence. Before merge
Agent review detailsSecurityNone. PR surfaceSource +30, Tests +45. Total +75 across 3 files. View PR surface stats
Review metricsNone. Mantis proof suggestionA Telegram live transcript would directly verify both the suppressed foreign-target command and the preserved own-target command behavior. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the early inbound-body guard, complete normal CI, and record a redacted live Telegram group check showing a foreign targeted command is quiet while this bot's targeted command still reaches OpenClaw. Do we have a high-confidence way to reproduce the issue? Yes—current-main source shows a Is this the best way to solve the issue? Yes—the guard belongs at the inbound-body owner before authorization, history, context construction, and dispatch, rather than compensating later in agent handling. The branch also preserves the existing own-bot command behavior in a sibling test. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 807506381a03. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
@openclaw-mantis telegram live proof: verify that |
Mantis Telegram Live QASummary: Mantis ran the Telegram live QA lane with Convex-leased credentials, rendered a redacted transcript in a Crabbox desktop browser, and captured screenshot/video evidence for PR review.
Telegram live transcript Telegram motion preview Motion-trimmed clips: Full videos: |
|
Merged via squash.
|


What Problem This Solves
Fixes an issue where Telegram groups with optional mentions could send
/command@other_botinto the OpenClaw agent as a normal user request.Why This Change Was Made
Telegram's
bot_commandentity is now checked at the inbound body owner before command authorization, history, or agent dispatch. A leading command explicitly addressed to another bot is dropped, while commands for this bot and later command tokens remain unchanged.This is the canonical runtime repair discovered during Beta 7 live QA. Beta-only QA adapter and scenario changes are intentionally excluded.
User Impact
OpenClaw no longer responds to Telegram commands intended for another bot in the same group.
Evidence
inboundEventKind: "user_request"for/status@other_botnode scripts/run-vitest.mjs extensions/telegram/src/bot-message-context.body.test.ts— 30 passed@other_bottargets before invoking the registered command handlergit diff --checkpassed