Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bot/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def _register_agentic_handlers(self, app: Application) -> None:
# Text messages -> Claude
app.add_handler(
MessageHandler(
filters.TEXT & ~filters.COMMAND,
filters.TEXT,
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Removing ~filters.COMMAND will cause registered slash commands (e.g. /start, /new, /status, /verbose, /repo, /restart) to be processed twice — once by the CommandHandler in the default group (0) and again by agentic_text in group 10.

In python-telegram-bot, handler groups are independent: a match in group 0 does not prevent handlers in group 10 from also firing. Only ApplicationHandlerStop can stop cross-group propagation, and it is not raised anywhere in this codebase.

This means typing /start will both run agentic_start and send "/start" to Claude as a text message.

To fix this while still passing through unknown slash commands, you should keep ~filters.COMMAND but add a fallback MessageHandler with filters.COMMAND in the same group (10) that only fires for unrecognised commands. Alternatively, you could move the CommandHandlers into group 10 as well (so they share the same group as the text handler and block it), or raise ApplicationHandlerStop in each command handler to prevent further group processing.

Copilot uses AI. Check for mistakes.
self._inject_deps(self.agentic_text),
),
group=10,
Expand Down
Loading