Skip to content

fix(discord): prioritize plugin commands under slash cap - #76209

Open
horstenegger wants to merge 1 commit into
NousResearch:mainfrom
horstenegger:fix/discord-plugin-command-priority
Open

fix(discord): prioritize plugin commands under slash cap#76209
horstenegger wants to merge 1 commit into
NousResearch:mainfrom
horstenegger:fix/discord-plugin-command-priority

Conversation

@horstenegger

Copy link
Copy Markdown

Summary

Discord rejects a global application-command sync above its 100-command cap (error 30032). Native commands are registered first and must remain highest priority. Previously, generated gateway built-ins were considered before explicit user plugin commands, so a full command catalog could silently omit a valid plugin command such as /krieger.

This reorders only the overflow tiers: after native commands, register explicit plugin commands before lower-priority generated built-ins. The existing conflict checks and the reserved final slot for the consolidated /skill command remain intact.

Tests

  • Added a deterministic cap regression that proves native commands, /krieger, and /skill all survive while the tree remains at or below 100 commands.
  • The regression fails on upstream main without this change (/krieger is absent) and passes with it.
  • scripts/run_tests.sh tests/gateway/test_discord_slash_commands.py tests/gateway/test_discord_sync_limit.py tests/gateway/test_discord_plugin_setup.py
  • python3 -m py_compile plugins/platforms/discord/adapter.py tests/gateway/test_discord_slash_commands.py
  • git diff --check

No managed-checkout cleanup or unrelated changes are included.

@teknium1

teknium1 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for the focused Discord cap-priority fix. The premise is confirmed on current main: plugins/platforms/discord/adapter.py:5490-5507 registers generated COMMAND_REGISTRY commands before the plugin pass at :5528-5542, and both consume the shared slot_cap reserved at :5474-5479. A plugin can therefore be omitted once generated commands fill the budget.

The diff reverses only those two overflow passes, leaving native registrations before both passes and preserving the /skill reservation and registration at plugins/platforms/discord/adapter.py:5552-5555. Built-in-name conflicts remain rejected when plugin commands are registered (hermes_cli/plugins.py:581-590). The added regression directly covers the full-cap scenario and asserts that native commands, the plugin command, and /skill remain present.

Automated hermes-sweeper review.

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins platform/discord Discord bot adapter P3 Low — cosmetic, nice to have labels Aug 1, 2026
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/discord Discord bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants