Skip to content

fix(cli): prevent custom_providers.model from overwriting manual model switches#9694

Closed
digging-airfare-4u wants to merge 1 commit into
NousResearch:mainfrom
digging-airfare-4u:fix/issue-9679
Closed

fix(cli): prevent custom_providers.model from overwriting manual model switches#9694
digging-airfare-4u wants to merge 1 commit into
NousResearch:mainfrom
digging-airfare-4u:fix/issue-9679

Conversation

@digging-airfare-4u

Copy link
Copy Markdown

Summary

Fixes a bug where custom_providers.model unconditionally overwrote manually switched models on every turn in the CLI.

Problem

_ensure_runtime_credentials() always assigned runtime.get(\"model\") to self.model. When a user manually switched models via /model, the next message would revert to the custom_providers default model.

Fix

Only apply the custom_providers.model fallback when self.model is either:

Changes

  • cli.py (_ensure_runtime_credentials): add guard before applying runtime_model

Related Issue

Fixes #9679

@digging-airfare-4u

Copy link
Copy Markdown
Author

ping — small fix for /model getting reverted by custom_providers.model. ready for review.

…l switches

_ensure_runtime_credentials() unconditionally assigned runtime_model
from custom_providers entries, overriding user-initiated /model switches.

Now it only applies the custom_providers default when self.model is
empty or still set to the provider name/slug (preserving the NousResearch#7828
fix for `hermes chat --model <provider-name>`).

Fixes NousResearch#9679
@teknium1

Copy link
Copy Markdown
Contributor

Closing as already fixed on main.

Triage notes (high confidence):
cli.py:4598-4607 on main already implements equivalent guard (checks self.model is unset, equals provider slug, or equals provider display name before applying runtime_model).

If you still see this on the latest version, please reopen with reproduction steps.

(Bulk-closed during a CLI triage sweep.)

@teknium1 teknium1 closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CLI _ensure_runtime_credentials() overwrites manual model switch with custom_providers.model field

3 participants