Skip to content

fix(provider): prevent Anthropic fallback from inheriting non-Anthropic base_url + fix(update): reset on stash conflict - #2388

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-31d7db3b
Mar 21, 2026
Merged

fix(provider): prevent Anthropic fallback from inheriting non-Anthropic base_url + fix(update): reset on stash conflict#2388
teknium1 merged 2 commits into
mainfrom
hermes/hermes-31d7db3b

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Two cherry-picked fixes from #2385 by @dieutx, split into separate commits.

Commit 1: Anthropic base_url leak (closes #2384)

When primary provider is openai-codex with base_url: chatgpt.com/backend-api/codex and fallback is anthropic, the Codex base URL leaked into the Anthropic client — Claude requests went to ChatGPT's endpoint and got 403 HTML back.

Fix: only honor config.model.base_url for Anthropic when config.model.provider == "anthropic". Two files: runtime_provider.py and auxiliary_client.py.

Commit 2: Stash restore conflict detection

_restore_stashed_changes() now detects unmerged files after git stash apply (even when returncode is 0) and does reset --hard to clean up. Prevents leaving the working tree in a broken state with conflict markers.

All 5686 tests pass.

…ic base_url

Only honor config.model.base_url for Anthropic resolution when
config.model.provider is actually "anthropic". This prevents a Codex
(or other provider) base_url from leaking into Anthropic runtime and
auxiliary client paths, which would send  requests to the wrong
endpoint.

Closes #2384
…rkers

When `hermes update` stashes local changes and the subsequent
`git stash apply` fails or leaves unmerged files, the conflict markers
(<<<<<<< etc.) were left in the working tree, making Hermes unrunnable
until manually cleaned up.

Now the update command runs `git reset --hard HEAD` to restore a clean
working tree before exiting, and also detects unmerged files even when
git stash apply reports success.

Closes #2348
@teknium1
teknium1 merged commit 55510cb into main Mar 21, 2026
1 check passed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…31d7db3b

fix(provider): prevent Anthropic fallback from inheriting non-Anthropic base_url + fix(update): reset on stash conflict
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…31d7db3b

fix(provider): prevent Anthropic fallback from inheriting non-Anthropic base_url + fix(update): reset on stash conflict
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…31d7db3b

fix(provider): prevent Anthropic fallback from inheriting non-Anthropic base_url + fix(update): reset on stash conflict
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…31d7db3b

fix(provider): prevent Anthropic fallback from inheriting non-Anthropic base_url + fix(update): reset on stash conflict
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.

Anthropic fallback can inherit Codex model.base_url and send Claude requests to chatgpt.com/backend-api/codex

1 participant