Skip to content

fix: ignore Telegram /start platform pings#31098

Closed
rdasilva1016-ui wants to merge 1 commit into
NousResearch:mainfrom
rdasilva1016-ui:fix/telegram-start-noop
Closed

fix: ignore Telegram /start platform pings#31098
rdasilva1016-ui wants to merge 1 commit into
NousResearch:mainfrom
rdasilva1016-ui:fix/telegram-start-noop

Conversation

@rdasilva1016-ui

Copy link
Copy Markdown
Contributor

Summary

Telegram automatically sends /start when a user opens or launches the bot. Hermes was treating this as a regular command, which could cause an unexpected help dump or interrupt an active agent session mid-run.

This fix registers /start as a known gateway-only command and makes it a silent no-op — no reply, no help, no agent interruption.

Changes

  • hermes_cli/commands.py: registers start as a gateway_only CommandDef so it is recognized and dispatchable without appearing in the CLI
  • gateway/run.py: intercepts /start on both the running-agent fast-path and the cold-path, returning an empty string immediately
  • tests/gateway/test_gateway_command_help.py: asserts start is in GATEWAY_KNOWN_COMMANDS
  • tests/gateway/test_session_race_guard.py: two tests for cold-path and active-session no-op behavior

Test Plan

python -m pytest tests/gateway/test_gateway_command_help.py::test_start_is_known_gateway_command tests/gateway/test_session_race_guard.py::test_start_command_is_noop_and_does_not_show_help tests/gateway/test_session_race_guard.py::test_start_command_is_noop_during_active_session -q -o 'addopts='

All 3 pass.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard platform/telegram Telegram bot adapter labels May 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing with open PR #20449 (same fix: register /start as gateway-known no-op). PR #22378 is also a duplicate of #20449 for this feature. Consider coordinating.

@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #33151 — your commit was cherry-picked onto current main with your authorship preserved in git log. The CommandDef + dual-intercept pattern shipped as-is. Thanks for the fix!

#33151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants