Skip to content

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

Open
dlkakbs wants to merge 1 commit intoNousResearch:mainfrom
dlkakbs:fix/webhook-platform-toolset-registration
Open

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

Conversation

@dlkakbs
Copy link
Copy Markdown
Contributor

@dlkakbs dlkakbs commented Mar 29, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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

1 participant