Skip to content

fix(gateway): hide required-arg commands from Telegram menu - #19343

Closed
mrbob-git wants to merge 1 commit into
NousResearch:mainfrom
mrbob-git:codex/fix-19288-telegram-required-commands
Closed

fix(gateway): hide required-arg commands from Telegram menu#19343
mrbob-git wants to merge 1 commit into
NousResearch:mainfrom
mrbob-git:codex/fix-19288-telegram-required-commands

Conversation

@mrbob-git

Copy link
Copy Markdown
Contributor

What does this PR do?

Telegram BotCommand menu selections send only the bare /command. Commands such as /background, /queue, and /steer require a prompt argument, so listing them in the Telegram native command menu lets users select an incomplete command that executes immediately.

This keeps those commands available for manual gateway dispatch, but skips commands whose args_hint starts with <...> when building the Telegram BotCommand menu. Plugin slash commands with required arguments get the same treatment.

Related Issue

Fixes #19288

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • hermes_cli/commands.py: skip required-argument commands when generating Telegram BotCommand entries.
  • tests/hermes_cli/test_commands.py: add regression coverage for core commands and plugin commands with required arguments.

How to Test

  1. Run python -m pytest tests/hermes_cli/test_commands.py -q -o addopts=.
  2. Confirm /background, /queue, and /steer are not returned by telegram_bot_commands().
  3. Confirm those commands remain in GATEWAY_KNOWN_COMMANDS for manual dispatch.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Windows 11

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Targeted validation passed locally:

python -m pytest tests/hermes_cli/test_commands.py -q -o addopts=
141 passed, 1 warning

I also attempted the repo wrapper with bash scripts/run_tests.sh tests/hermes_cli/test_commands.py -q -o addopts=, but this Windows checkout has CRLF line endings and bash exited before running the script (set: pipefail\r: invalid option name).

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter labels May 3, 2026
@teknium1

teknium1 commented May 3, 2026

Copy link
Copy Markdown
Contributor

Salvaged via #19400 onto current main — your commit's authorship was preserved. Thanks @mrbob-git!

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

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Slash-command autocomplete should not execute /background immediately when the command needs a prompt

3 participants