Skip to content

[Enhancement]: Hermes adapter: send an anthropic route's requests to its configured endpoint whatever its path #666

Description

@cv

Affected area

Harness adapter

Problem or opportunity

A Hermes runtime whose selected model uses provider anthropic with a base_url such as https://gateway.example/v1 sends its Messages requests to https://api.anthropic.com, not to that endpoint.

  • The Hermes adapter writes the model into Hermes's config.yaml as {provider: anthropic, default: <model>, base_url: <endpoint>}: _interface_model turns only openai and custom routes into Hermes's custom provider and passes an anthropic route through unchanged, as build_hermes_config does.
  • Hermes uses model.base_url for its anthropic provider only when _anthropic_base_url_override_ok accepts it: the host is api.anthropic.com or ends in .anthropic.com, .claude.com or .azure.com, or the path ends in /anthropic or /anthropic/v1 (or Kimi's api.kimi.com/coding). For any other URL it falls back to https://api.anthropic.com, "so a stale non-Anthropic URL cannot hijack native Anthropic". Hermes keeps this rule on purpose, and it fits a configuration a person edits; a Fabric route's base_url is the endpoint the consumer declared, not a stale value.

A consumer can't make Hermes use such an endpoint: it can only refuse the endpoint by copying Hermes's rule, or tell users to change the endpoint.

Evidence, from NVIDIA/NemoClaw#14538: a managed Docker gateway on OpenShell 0.1.8, one Hermes sandbox (Hermes b200f5bc, Fabric 135147a0) whose route uses an anthropic provider at a stub that serves Anthropic's Messages API.

Provider endpoint Result
http://172.30.153.1:17854/v1 No reply within 45 seconds; the stub received only Hermes's metadata requests
http://172.30.153.1:17854/anthropic/v1 Hermes's API server answered in 3.7 seconds, through POST /anthropic/v1/messages with x-api-key

For the first endpoint, the sandbox's supervisor refused each attempt:

OCSF NET:OPEN [MED] DENIED /usr/local/bin/python3.14(0) -> api.anthropic.com:443 [reason:transparent_tcp_policy_denied]

and Hermes's errors.log shows provider=anthropic base_url=https://api.anthropic.com ... APIConnectionError.

The reproduction went through Hermes's API server, which reads config.yaml. The embedded agent gets the endpoint as an argument (adapter.py:404-407), and Hermes's explicit path prefers that argument (_explicit_anthropic); whether invoke is affected wasn't tested.

Proposed enhancement

When the selected model's provider is anthropic and it has a base_url, configure Hermes so that every Hermes process (the embedded agent, the API server, the gateway and the dashboard) sends Messages requests to that base_url, whatever its path.

One possible shape, untested: write the route as Hermes's custom provider with api_mode: anthropic_messages, as the adapter already writes openai routes as custom. Hermes's plain custom provider honors a configured api_mode (_resolve_plain_custom_api_mode). Points to check with it:

  • The key header: Hermes's Anthropic client sends x-api-key, except Authorization: Bearer for the hosts in _requires_bearer_auth (MiniMax, Azure, Nous Portal and others). An OpenShell anthropic provider places its key in x-api-key.
  • The request path for a base_url that ends in /v1, so that https://gateway.example/v1 gets POST /v1/messages, as .../anthropic/v1 gets POST /anthropic/v1/messages today.
  • The key's environment variable, which providers.custom.key_env binds for openai routes.

Public contract and compatibility impact

  • Rust API: none.
  • Python API: none.
  • Schemas or adapter contract: none; the model's provider and base_url keep their meaning.
  • Harness or consumer integrations: a Hermes runtime with an anthropic model sends its requests to the declared base_url for every endpoint, not only for those Hermes recognizes as Anthropic's.
  • Backward compatibility: an anthropic model whose base_url Hermes doesn't recognize stops reaching https://api.anthropic.com; endpoints Hermes recognizes keep working.

Alternatives considered

Acceptance criteria

  • A Hermes runtime with an anthropic model at a base_url such as https://gateway.example/v1 sends its Messages requests, with the key in x-api-key, to that endpoint from the embedded agent and from Hermes's API server.
  • Endpoints that work today, such as https://gateway.example/anthropic/v1 and https://api.anthropic.com, keep working.
  • Adapter tests cover an anthropic model at a path Hermes doesn't recognize.

Additional context

  • NemoClaw tracks this in NVIDIA/NemoClaw#14538 and documents it as a current limit; NVIDIA/NemoClaw#14532 made Hermes start with an anthropic provider.
  • Revisions: Fabric main at a2fffa32 (NemoClaw pins 135147a0, whose configuration.py has the same code), Hermes Agent b200f5bc (v0.22.7).

Duplicate check

  • I searched the existing issues and did not find a duplicate.

Activity

  1. added
    enhancement
    on Nov 18, 2026
  2. added theissue type on Nov 18, 2026
  3. added a commit that references this issue on Nov 19, 2026
    c6d1093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions