hermes - ✅(Solved) Fix [Feature]: Per-Route Model/Provider Override for Webhook Routes [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#12788Fetched 2026-04-20 12:16:59
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1labeled ×1referenced ×1

Fix Action

Fix / Workaround

This is limiting when different webhook events have different complexity requirements. For example, a GitHub PR code review route benefits from a high-capability model, while a simple deploy notification route could use a smaller, faster, cheaper model. Today, the only workaround is running multiple Hermes instances with separate HERMES_HOME directories, each configured with a different model and listening on a different port.

PR fix notes

PR #12909: feat(webhook): add per-route model/provider override

Description (problem / solution / changelog)

Summary

Closes #12788

Adds optional model and provider fields to webhook route configuration, allowing per-route override of the global model/provider defaults.

Changes

  • gateway/platforms/webhook.py: When a webhook route has model or provider set, injects them into gateway_runner._session_model_overrides before handling the message. Reuses the existing session model override mechanism (same as /model command).
  • tests/gateway/test_webhook_adapter.py: 5 new test cases covering model+provider, model-only, provider-only, no override, and graceful handling without gateway runner.

Config example

platforms.webhook.extra.routes:
  my-route:
    secret: "..."
    prompt: "..."
    model: "claude-sonnet-4-20250514"
    provider: "anthropic"

All existing + new tests pass (41 total in webhook adapter tests).

Changed files

  • gateway/platforms/webhook.py (modified, +17/-0)
  • tests/gateway/test_webhook_adapter.py (modified, +154/-0)

Code Example

platforms:
  webhook:
    enabled: true
    extra:
      routes:
        github-pr:
          events: ["pull_request"]
          secret: "github-webhook-secret"
          model: "anthropic:claude-sonnet-4-20250514"
          prompt: |
            Review this pull request:
            Repository: {repository.full_name}
            PR #{number}: {pull_request.title}
          skills: ["github-code-review"]
          deliver: "github_comment"
          deliver_extra:
            repo: "{repository.full_name}"
            pr_number: "{number}"

        deploy-notify:
          events: ["push"]
          secret: "deploy-secret"
          model: "ollama:llama3"
          prompt: "New push to {repository.full_name} branch {ref}: {head_commit.message}"
          deliver: "telegram"

---
RAW_BUFFERClick to expand / collapse

Problem or Use Case

When configuring webhook routes in config.yaml, there is no way to specify which model or provider should be used for a given route's agent run. All webhook-triggered runs inherit the global model/provider configuration.

This is limiting when different webhook events have different complexity requirements. For example, a GitHub PR code review route benefits from a high-capability model, while a simple deploy notification route could use a smaller, faster, cheaper model. Today, the only workaround is running multiple Hermes instances with separate HERMES_HOME directories, each configured with a different model and listening on a different port.

Proposed Solution

Add optional model and/or provider fields to the webhook route configuration schema:

platforms:
  webhook:
    enabled: true
    extra:
      routes:
        github-pr:
          events: ["pull_request"]
          secret: "github-webhook-secret"
          model: "anthropic:claude-sonnet-4-20250514"
          prompt: |
            Review this pull request:
            Repository: {repository.full_name}
            PR #{number}: {pull_request.title}
          skills: ["github-code-review"]
          deliver: "github_comment"
          deliver_extra:
            repo: "{repository.full_name}"
            pr_number: "{number}"

        deploy-notify:
          events: ["push"]
          secret: "deploy-secret"
          model: "ollama:llama3"
          prompt: "New push to {repository.full_name} branch {ref}: {head_commit.message}"
          deliver: "telegram"

The model field would accept the existing provider:model syntax. When omitted, behavior remains unchanged (falls back to the global default).

Additional Context

The skills field already allows per-route customization of agent capabilities. A model field would be a natural extension of this pattern, giving route authors full control over the cost/capability tradeoff per event type.

Alternatives Considered

No response

Feature Type

Gateway / messaging improvement

Scope

None

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

extent analysis

TL;DR

Add optional model and/or provider fields to the webhook route configuration schema to allow per-route customization of models and providers.

Guidance

  • Review the proposed solution and consider adding the model field to the webhook route configuration schema to enable per-route model customization.
  • Update the config.yaml file to include the model field for each webhook route, using the existing provider:model syntax.
  • Test the updated configuration to ensure that each webhook route uses the specified model and provider.
  • Consider the cost and capability tradeoffs when selecting models for each route, as demonstrated in the example configuration.

Example

platforms:
  webhook:
    enabled: true
    extra:
      routes:
        github-pr:
          events: ["pull_request"]
          secret: "github-webhook-secret"
          model: "anthropic:claude-sonnet-4-20250514"
          # ...
        deploy-notify:
          events: ["push"]
          secret: "deploy-secret"
          model: "ollama:llama3"
          # ...

Notes

The proposed solution requires updates to the configuration schema and may require additional testing to ensure compatibility with existing routes and models.

Recommendation

Apply workaround by adding the model field to the webhook route configuration schema, as it provides a flexible solution for per-route model customization.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Feature]: Per-Route Model/Provider Override for Webhook Routes [1 pull requests, 1 participants]