fix(provider): prevent Anthropic fallback from inheriting non-Anthropic base_url + fix(update): reset on stash conflict - #2388
Merged
Conversation
…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
This was referenced Mar 21, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-codexwithbase_url: chatgpt.com/backend-api/codexand fallback isanthropic, 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_urlfor Anthropic whenconfig.model.provider == "anthropic". Two files:runtime_provider.pyandauxiliary_client.py.Commit 2: Stash restore conflict detection
_restore_stashed_changes()now detects unmerged files aftergit stash apply(even when returncode is 0) and doesreset --hardto clean up. Prevents leaving the working tree in a broken state with conflict markers.All 5686 tests pass.