Skip to content

fix(gateway): register webhook platform and toolset to fix KeyError on agent runs - #3775

Closed
dlkakbs wants to merge 1 commit into
NousResearch:mainfrom
dlkakbs:fix/webhook-platform-toolset-registration
Closed

fix(gateway): register webhook platform and toolset to fix KeyError on agent runs #3775
dlkakbs wants to merge 1 commit into
NousResearch:mainfrom
dlkakbs:fix/webhook-platform-toolset-registration

Conversation

@dlkakbs

@dlkakbs dlkakbs commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Webhook-triggered agent runs crashed with KeyError: 'webhook' because the webhook platform had no entry in PLATFORMS (tools_config.py) and no corresponding toolset in TOOLSETS (toolsets.py). When a webhook request was accepted and routed to the gateway, _get_platform_tools() tried to look up PLATFORMS["webhook"] and raised KeyError.

This PR adds the two missing registrations, following the exact same pattern used by every other first-class platform (api_server, telegram, discord, etc.).

Related Issue

Fixes #3773

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✅ Tests (adding or improving test coverage)

Changes Made

  • hermes_cli/tools_config.py: added "webhook" entry to PLATFORMS
  • toolsets.py: added "hermes-webhook" toolset using _HERMES_CORE_TOOLS
  • tests/gateway/test_webhook_toolset.py: added toolset and platform registration tests (mirrors test_api_server_toolset.py)

How to Test

  1. Enable webhook platform in config and start the gateway
  2. Configure a static route with secret: INSECURE_NO_AUTH for local testing
  3. Send a POST to /webhooks/ — agent run should complete without KeyError: 'webhook'
  4. Run pytest tests/gateway/test_webhook_toolset.py -q — all 7 tests pass

Checklist

  • My commit messages follow Conventional Commits
  • My PR contains only changes related to this fix
  • I've run pytest tests/gateway/test_webhook_toolset.py -q and all tests pass
  • I've added tests for my changes

Documentation & Housekeeping

  • I've updated relevant documentation — N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've considered cross-platform impact — N/A

…n agent runs

Webhook-triggered agent runs crashed with KeyError: 'webhook' because
the platform was missing from PLATFORMS in tools_config.py and the
corresponding toolset was missing from TOOLSETS in toolsets.py.

Adds hermes-webhook toolset and webhook platform registration to match
the existing pattern used by all other first-class platforms.

Fixes NousResearch#3773
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the contribution! The fix you're proposing here has already landed on main.

Automated hermes-sweeper review found:

The test file (tests/gateway/test_webhook_toolset.py) is the one piece not yet on main. If you'd like to open a focused PR adding just that test coverage, that would be a welcome follow-up!

@teknium1 teknium1 closed this Apr 27, 2026
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround platform/webhook Webhook / API server comp/gateway Gateway runner, session dispatch, delivery comp/tools Tool registry, model_tools, toolsets labels Apr 27, 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 comp/tools Tool registry, model_tools, toolsets P1 High — major feature broken, no workaround platform/webhook Webhook / API server type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Webhook-triggered agent runs crash with KeyError: 'webhook' due to missing platform/toolset registration

3 participants