fix: set api_mode when switching providers via hermes model#3686
Closed
HenkDz wants to merge 1 commit intoNousResearch:mainfrom
Closed
fix: set api_mode when switching providers via hermes model#3686HenkDz wants to merge 1 commit intoNousResearch:mainfrom
HenkDz wants to merge 1 commit intoNousResearch:mainfrom
Conversation
When switching providers with 'hermes model', the api_mode field in config.yaml was not updated for most providers (Z.AI, MiniMax, Kimi, OpenRouter, Custom). The previous provider's api_mode persisted, causing requests to hit the wrong API endpoint path. For example, switching from Copilot (codex_responses) to Z.AI left api_mode: codex_responses, causing 404 on /v4/responses. Set api_mode: chat_completions for all chat-completions-based providers: - OpenRouter - Custom endpoints - Kimi / Moonshot - Z.AI / MiniMax (generic API-key provider flow) Copilot and Copilot-ACP flows already correctly set api_mode. Fixes NousResearch#3685
Contributor
Author
|
@teknium1 I do not think the Failed test is realted to our changes, it checks for the string |
Contributor
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
hermes modeldoes not updateapi_modein~/.hermes/config.yamlwhen switching to most providers. The previous provider'sapi_modepersists, causing requests to the wrong endpoint.The bug
Switching from Copilot (
api_mode: codex_responses) to Z.AI leaves the staleapi_mode: codex_responsesin config. Z.AI doesn't support/v4/responses, so every request fails with 404.The fix
Set
model.api_mode = "chat_completions"in all provider flows that use the chat completions API surface:chat_completionschat_completionschat_completionschat_completionsTesting
resolveProvider()in the Paperclip adapter correctly falls back to model-name inference when config model doesn't match requested modelFixes #3685