hermes - 💡(How to fix) Fix bug(desktop): PROVIDER_BASE_URLS.anthropic hardcoded with /v1 suffix overwrites config.yaml base_url on every restart

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…

Root Cause

Every time Hermes Agent Desktop (v0.7.4, macOS) is restarted or a model is selected via the UI, config.yaml has model.base_url overwritten from https://api.anthropic.com to https://api.anthropic.com/v1. This causes all Anthropic API calls to fail with HTTP 404 because the Anthropic SDK then constructs /v1/v1/messages (double /v1).

Fix Action

Fix

Change line 192 in out/main/index.js:

// Before
anthropic: "https://api.anthropic.com/v1"

// After
anthropic: "https://api.anthropic.com"

The Python-side code (hermes_cli/runtime_provider.py, lines 370, 407, 954, 1646) already correctly strips trailing /v1 when routing through the Anthropic native SDK — the Desktop Electron layer should match this behavior.

Code Example

// line 192 in out/main/index.js (app.asar)
const PROVIDER_BASE_URLS = {
  openai: "https://api.openai.com/v1",
  ...
  anthropic: "https://api.anthropic.com/v1"   // ← BUG: /v1 should not be here
};

---

// renderer (selectModel callback)
const effectiveBaseUrl = provider === "custom" ? baseUrl : "";
await window.hermesAPI.setModelConfig(provider, model, effectiveBaseUrl, profile);

// main process setModelConfig()
const effectiveBaseUrl = baseUrl || canonicalProviderBaseUrl(provider) || "";
if (effectiveBaseUrl) {
    content = upsertBlockChild(content, "model", "base_url", effectiveBaseUrl);
}

---

// Before
anthropic: "https://api.anthropic.com/v1"

// After
anthropic: "https://api.anthropic.com"

---

npx @electron/asar extract "/Applications/Hermes Agent.app/Contents/Resources/app.asar" /tmp/hermes_patch
sed -i '' 's|anthropic: "https://api.anthropic.com/v1"|anthropic: "https://api.anthropic.com"|' /tmp/hermes_patch/out/main/index.js
npx @electron/asar pack /tmp/hermes_patch "/Applications/Hermes Agent.app/Contents/Resources/app.asar"
RAW_BUFFERClick to expand / collapse

Bug Description

Every time Hermes Agent Desktop (v0.7.4, macOS) is restarted or a model is selected via the UI, config.yaml has model.base_url overwritten from https://api.anthropic.com to https://api.anthropic.com/v1. This causes all Anthropic API calls to fail with HTTP 404 because the Anthropic SDK then constructs /v1/v1/messages (double /v1).

Root Cause (traced in app.asar)

In out/main/index.js, the PROVIDER_BASE_URLS map has an incorrect value for anthropic:

// line 192 in out/main/index.js (app.asar)
const PROVIDER_BASE_URLS = {
  openai: "https://api.openai.com/v1",
  ...
  anthropic: "https://api.anthropic.com/v1"   // ← BUG: /v1 should not be here
};

The setModelConfig() function uses this as a fallback when the renderer passes an empty baseUrl (which it does for all non-custom providers):

// renderer (selectModel callback)
const effectiveBaseUrl = provider === "custom" ? baseUrl : "";
await window.hermesAPI.setModelConfig(provider, model, effectiveBaseUrl, profile);

// main process setModelConfig()
const effectiveBaseUrl = baseUrl || canonicalProviderBaseUrl(provider) || "";
if (effectiveBaseUrl) {
    content = upsertBlockChild(content, "model", "base_url", effectiveBaseUrl);
}

So every time a user selects anthropic as provider, PROVIDER_BASE_URLS["anthropic"] (https://api.anthropic.com/v1) gets written into config.yaml. The Anthropic native SDK then appends its own /v1/messages, resulting in /v1/v1/messages → 404.

Fix

Change line 192 in out/main/index.js:

// Before
anthropic: "https://api.anthropic.com/v1"

// After
anthropic: "https://api.anthropic.com"

The Python-side code (hermes_cli/runtime_provider.py, lines 370, 407, 954, 1646) already correctly strips trailing /v1 when routing through the Anthropic native SDK — the Desktop Electron layer should match this behavior.

Steps to Reproduce

  1. Set model.base_url: https://api.anthropic.com in ~/.hermes/config.yaml
  2. Open Hermes Agent Desktop and select any Anthropic model
  3. Check ~/.hermes/config.yamlbase_url is now https://api.anthropic.com/v1

Workaround (until fixed)

Set provider to custom in Desktop UI and manually enter https://api.anthropic.com as base URL — this bypasses the PROVIDER_BASE_URLS fallback.

Alternatively, patch app.asar directly:

npx @electron/asar extract "/Applications/Hermes Agent.app/Contents/Resources/app.asar" /tmp/hermes_patch
sed -i '' 's|anthropic: "https://api.anthropic.com/v1"|anthropic: "https://api.anthropic.com"|' /tmp/hermes_patch/out/main/index.js
npx @electron/asar pack /tmp/hermes_patch "/Applications/Hermes Agent.app/Contents/Resources/app.asar"

Environment

  • Hermes Agent Desktop: v0.7.4
  • macOS: 15.5
  • Provider: anthropic (native)

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