hermes - ✅(Solved) Fix Anthropic provider 404s when base_url includes /v1 (SDK adds its own) [3 pull requests, 1 comments, 2 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#24833Fetched 2026-05-14 03:51:24
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×4cross-referenced ×3commented ×1

Fix Action

Fixed

PR fix notes

PR #24873: fix(anthropic): strip native SDK /v1 base URL suffix

Description (problem / solution / changelog)

Summary

  • normalize native Anthropic SDK base URLs so https://api.anthropic.com/v1 becomes https://api.anthropic.com before the SDK appends /v1/messages
  • preserve /v1 paths for custom and third-party Anthropic-compatible endpoints
  • add regression coverage for native /v1, trailing slash, and custom /v1 base URLs

Fixes #24833

Tests

  • uv run --frozen python -m pytest tests/agent/test_anthropic_adapter.py::TestBuildAnthropicClient -q -o 'addopts='
  • uv run --frozen python -m pytest tests/agent/test_anthropic_adapter.py -q -o 'addopts='
  • uv run --frozen python -m pytest tests/agent/test_auxiliary_transport_autodetect.py -q -o 'addopts='
  • uv run --frozen python -m py_compile agent/anthropic_adapter.py
  • uv run --with ruff ruff check agent/anthropic_adapter.py tests/agent/test_anthropic_adapter.py
  • git diff --check

Changed files

  • agent/anthropic_adapter.py (modified, +34/-2)
  • tests/agent/test_anthropic_adapter.py (modified, +19/-0)

PR #24876: fix(anthropic): strip trailing /v1 from base_url to prevent double-path 404s

Description (problem / solution / changelog)

Summary

Fixes #24833: When users configure for the Anthropic provider, the Anthropic SDK (which appends internally) produces a double-path like → 404.

Root cause

in passes the user-supplied directly to . The SDK then appends , so:

    • SDK → ✓
    • SDK → → 404 ✗

Fix

Strip trailing from before passing to the SDK for non-Azure endpoints. Azure AI Foundry endpoints use their own versioning scheme and must NOT be stripped.

Tests (14 total — all pass)

6 new test cases added to :

TestWhat it covers
Custom proxies with also fixed
Azure endpoints keep full URL
No-op when no trailing
→ stripped to bare domain
(non-trailing) not stripped

Checklist

  • Fix implemented (2 files, 65 lines added)
  • Tests written (exact bug scenario + edge cases)
  • All checks passed! passes
  • All 14 tests pass
  • CI status
  • Review

Changed files

  • agent/anthropic_adapter.py (modified, +20/-1)
  • tests/agent/test_anthropic_adapter.py (modified, +56/-0)

PR #24877: fix(anthropic): strip native base url v1 suffix

Description (problem / solution / changelog)

Summary

  • normalize native Anthropic base URLs before constructing the Anthropic SDK client
  • strip a trailing /v1 only for api.anthropic.com, since the SDK appends /v1 itself
  • preserve third-party Anthropic-compatible /v1 base URLs unchanged

Fixes #24833

Tests

  • scripts/run_tests.sh tests/agent/test_minimax_provider.py tests/agent/test_auxiliary_client_anthropic_custom.py tests/agent/test_bedrock_1m_context.py tests/test_ctx_halving_fix.py
  • .venv/bin/ruff check agent/anthropic_adapter.py tests/agent/test_minimax_provider.py

Changed files

  • agent/anthropic_adapter.py (modified, +22/-2)
  • tests/agent/test_minimax_provider.py (modified, +25/-0)
RAW_BUFFERClick to expand / collapse

When configuring model.provider: anthropic, Hermes lazy-installs anthropic==0.86.0 (native SDK). The SDK appends /v1 to base_url internally. If the user's base_url is set to https://api.anthropic.com/v1 (as Hermes config setup suggests), requests hit https://api.anthropic.com/v1/v1/messages → 404. Setting base_url to https://api.anthropic.com (no /v1) fixes it. Suggest: validate base_url for anthropic provider and strip trailing /v1, or update setup wizard to use the correct base.

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