hermes-agent/hermes_cli
Teknium 8ffd44a6f9
feat(discord): register skills as native slash commands via shared gateway logic (#5603)
Centralize the skill → slash command registration that Telegram already had
in commands.py so Discord uses the exact same priority system, filtering,
and cap enforcement:

  1. Core/built-in commands (never trimmed)
  2. Plugin commands (never trimmed)
  3. Skill commands (fill remaining slots, alphabetical, only tier trimmed)

Changes:

hermes_cli/commands.py:
  - Rename _TG_NAME_LIMIT → _CMD_NAME_LIMIT (32 chars shared by both platforms)
  - Rename _clamp_telegram_names → _clamp_command_names (generic)
  - Extract _collect_gateway_skill_entries() — shared plugin + skill
    collection with platform filtering, name sanitization, description
    truncation, and cap enforcement
  - Refactor telegram_menu_commands() to use the shared helper
  - Add discord_skill_commands() that returns (name, desc, cmd_key) triples
  - Preserve _sanitize_telegram_name() for Telegram-specific name cleaning

gateway/platforms/discord.py:
  - Call discord_skill_commands() from _register_slash_commands()
  - Create app_commands.Command per skill entry with cmd_key callback
  - Respect 100-command global Discord limit
  - Log warning when skills are skipped due to cap

Backward-compat aliases preserved for _TG_NAME_LIMIT and
_clamp_telegram_names.

Tests: 9 new tests (7 Discord + 2 backward-compat), 98 total pass.

Inspired by PR #5498 (sprmn24). Closes #5480.
2026-04-06 12:09:36 -07:00
..
__init__.py chore: release v0.7.0 (2026.4.3) (#4812) 2026-04-03 11:14:55 -07:00
auth.py feat(providers): add Google AI Studio (Gemini) as a first-class provider 2026-04-06 10:28:03 -07:00
auth_commands.py fix: hermes auth remove now clears env-seeded credentials permanently (#5285) 2026-04-05 12:00:53 -07:00
banner.py chore: prepare Hermes for Homebrew packaging (#4099) 2026-03-30 17:34:43 -07:00
callbacks.py feat(approvals): make dangerous command approval timeout configurable (#3886) 2026-03-30 00:02:02 -07:00
checklist.py fix: add TTY guard to interactive CLI commands to prevent CPU spin (#3933) 2026-03-30 08:10:23 -07:00
claw.py feat: add post-migration cleanup for OpenClaw directories (#4100) 2026-03-30 17:39:08 -07:00
clipboard.py fix: clean up empty file after failed wl-paste clipboard extraction 2026-03-11 02:56:19 -07:00
codex_models.py fix: add gpt-5.4-mini to Codex fallback catalog (#3855) 2026-03-29 20:10:00 -07:00
colors.py feat: respect NO_COLOR env var and TERM=dumb (#4079) 2026-03-30 17:07:21 -07:00
commands.py feat(discord): register skills as native slash commands via shared gateway logic (#5603) 2026-04-06 12:09:36 -07:00
config.py feat(providers): add Google AI Studio (Gemini) as a first-class provider 2026-04-06 10:28:03 -07:00
copilot_auth.py chore: remove ~100 unused imports across 55 files (#3016) 2026-03-25 15:02:03 -07:00
cron.py feat(cron): add script field for pre-run data collection (#5082) 2026-04-04 10:43:39 -07:00
curses_ui.py fix: add TTY guard to interactive CLI commands to prevent CPU spin (#3933) 2026-03-30 08:10:23 -07:00
default_soul.py fix: reset default SOUL.md to baseline identity text (#3159) 2026-03-26 01:34:27 -07:00
doctor.py feat: config structure validation — detect malformed YAML at startup (#5426) 2026-04-05 23:31:20 -07:00
env_loader.py chore: remove ~100 unused imports across 55 files (#3016) 2026-03-25 15:02:03 -07:00
gateway.py refactor: simplify _get_service_pids — dedupe systemd scopes, fix self-import, harden launchd parsing 2026-04-06 00:09:06 -07:00
logs.py feat: centralized logging, instrumentation, hermes logs CLI, gateway noise fix (#5430) 2026-04-06 00:08:20 -07:00
main.py fix: update Gemini model catalog + wire models.dev as live model source 2026-04-06 10:28:03 -07:00
mcp_config.py fix: add TTY guard to interactive CLI commands to prevent CPU spin (#3933) 2026-03-30 08:10:23 -07:00
memory_setup.py fix(honcho): plugin drift overhaul -- observation config, chunking, setup wizard, docs, dead code cleanup 2026-04-05 12:34:11 -07:00
model_normalize.py Fix #5211: Preserve dots in OpenCode Go model names 2026-04-06 11:25:06 -07:00
model_switch.py feat: config structure validation — detect malformed YAML at startup (#5426) 2026-04-05 23:31:20 -07:00
models.py fix: update Gemini model catalog + wire models.dev as live model source 2026-04-06 10:28:03 -07:00
nous_subscription.py Merge branch 'main' into rewbs/tool-use-charge-to-subscription 2026-03-31 09:29:43 +09:00
pairing.py chore: fix 154 f-strings, simplify getattr/URL patterns, remove dead code (#3119) 2026-03-25 19:47:58 -07:00
plugins.py feat(plugins): pre_api_request/post_api_request with narrow payloads 2026-04-05 23:31:29 -07:00
plugins_cmd.py fix(plugins): reject plugin names that resolve to the plugins root 2026-04-05 18:40:45 -07:00
profiles.py fix(memory): profile-scoped memory isolation and clone support (#4845) 2026-04-03 13:10:11 -07:00
providers.py feat: /model command — models.dev primary database + --provider flag (#5181) 2026-04-05 01:04:44 -07:00
runtime_provider.py fix(nous): don't use OAuth access_token as inference API key 2026-04-06 10:04:02 -07:00
setup.py fix: update Gemini model catalog + wire models.dev as live model source 2026-04-06 10:28:03 -07:00
skills_config.py fix: webhook platform support — skip home channel prompt, disable tool progress (salvage #4363) (#4660) 2026-04-02 14:00:22 -07:00
skills_hub.py fix(skills): validate hub bundle paths before install (#3986) 2026-03-30 08:37:19 -07:00
skin_engine.py refactor: consolidate get_hermes_home() and parse_reasoning_effort() (#3062) 2026-03-25 15:54:28 -07:00
status.py Merge branch 'main' into rewbs/tool-use-charge-to-subscription 2026-03-31 09:29:43 +09:00
tools_config.py feat: add docs links to setup wizard sections (#5283) 2026-04-05 11:46:13 -07:00
uninstall.py chore: fix 154 f-strings, simplify getattr/URL patterns, remove dead code (#3119) 2026-03-25 19:47:58 -07:00
webhook.py fix: replace user-facing hardcoded ~/.hermes paths with display_hermes_home() 2026-03-28 23:47:21 -07:00