Skip to content

fix(discord): register goal slash command (#21589) - #22105

Closed
Tranquil-Flow wants to merge 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/21589-discord-goal-slash-command
Closed

fix(discord): register goal slash command (#21589)#22105
Tranquil-Flow wants to merge 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/21589-discord-goal-slash-command

Conversation

@Tranquil-Flow

@Tranquil-Flow Tranquil-Flow commented May 8, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Registers Discord's native /goal slash command so Discord interactions route to the existing gateway /goal command instead of timing out with "Application did not respond". The fix reuses the existing simple slash-command dispatch path and does not change goal command semantics.

Related Issue

Fixes #21589

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

  • gateway/platforms/discord.py: add the missing slash_goal registration.
  • tests/gateway/test_discord_slash_commands.py: verify /goal is registered and invokes _run_simple_slash(interaction, "/goal").

How to Test

  1. python3 -m pytest tests/gateway/test_discord_slash_commands.py -k 'goal_slash_command' -o 'addopts=' --tb=short -q
  2. Broader focused file: python3 -m pytest tests/gateway/test_discord_slash_commands.py -o 'addopts=' --tb=short -q
  3. Fail-without-fix proof: with the discord.py handler reverted, the new goal slash command test fails.

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: macOS 15 (Darwin 24.6.0)

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

python3 -m pytest tests/gateway/test_discord_slash_commands.py -o 'addopts=' --tb=short -q
# slash_goal test passes; revert source → fails (fail-without-fix proof)

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter labels May 8, 2026
@Tranquil-Flow
Tranquil-Flow force-pushed the fix/21589-discord-goal-slash-command branch from 1ecd93a to a109d1a Compare May 25, 2026 09:11
@talwayh1

Copy link
Copy Markdown

CI Attribution Check Fix (auto-heal)

The fix@local email in your commit is not in scripts/release.py AUTHOR_MAP, causing the Contributor Attribution Check to fail.

A fix has been opened as PR #31982:

Once merged, this email will be mapped to your GitHub username (Tranquil-Flow).

Ref: CI run https://github.com/NousResearch/hermes-agent/actions/runs/26392838715

@Tranquil-Flow
Tranquil-Flow force-pushed the fix/21589-discord-goal-slash-command branch from a109d1a to 9ae4b08 Compare May 25, 2026 11:03
@teknium1

Copy link
Copy Markdown
Contributor

This looks implemented on current main by the registry-driven Discord slash-command registration path, so the specific /goal manual registration PR is now redundant.

Evidence from an automated hermes-sweeper review:

  • hermes_cli/commands.py:108 defines CommandDef("goal", ...) with gateway-available defaults and an args hint for text | pause | resume | clear | status.
  • hermes_cli/commands.py:424 makes non-cli_only commands gateway-available.
  • plugins/platforms/discord/adapter.py:3400 iterates COMMAND_REGISTRY during Discord slash registration and adds missing gateway commands to the command tree.
  • plugins/platforms/discord/adapter.py:3366 builds the generated callback so it dispatches via _run_simple_slash(interaction, f"/{__name} {args}".strip()), which covers /goal and its arguments.
  • Commit 22d22cd75c656bf90f2a179e7df73d06654ed57f added this auto-registration behavior for all gateway commands, so future registry entries do not need separate manual Discord registrations.

Thanks for filing the targeted fix and test; the broader registry-based fix on main now covers the same bug class.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
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 P2 Medium — degraded but workaround exists platform/discord Discord bot adapter sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] /goal slash command times out on Discord — handler not registered in discord.py

4 participants