Skip to content

The agent that grows with you

fix(profiles): keep bare custom provider tuning in the model seed

kshitijk4poor424aa90f22fb
diff --git a/hermes_cli/profile_model_seed.py b/hermes_cli/profile_model_seed.py
index 2f71f400418..74451746571 100644
--- a/hermes_cli/profile_model_seed.py
+++ b/hermes_cli/profile_model_seed.py
@@ -28,10 +28,11 @@ def launch_model_seed(source_cfg: dict) -> dict:
if selected is None:
# Exact built-in keys carry provider tuning even without an endpoint URL.
exact = providers.get(provider)
+ # Bare ``custom`` runs as provider ``custom`` and reads ``providers.custom`` tuning too.
if (
isinstance(exact, dict)
and requested not in {"", "auto"}
- and _shadowed_by_builtin(requested)
+ and (requested == "custom" or _shadowed_by_builtin(requested))
):
seed["providers"] = {provider: exact}
return seed
diff --git a/tests/hermes_cli/test_profile_model_seed.py b/tests/hermes_cli/test_profile_model_seed.py
index 49d18101123..ad68038fc9e 100644
--- a/tests/hermes_cli/test_profile_model_seed.py
+++ b/tests/hermes_cli/test_profile_model_seed.py
@@ -112,14 +112,28 @@ def test_builtin_name_collision_only_copies_explicit_custom_selection(
assert "custom_providers" not in created
-def test_fresh_profile_keeps_explicit_builtin_provider_settings(tmp_path, monkeypatch):
+ "model",
+ [
+ {"provider": "openrouter", "default": "synthetic-model"},
+ {
+ "provider": "custom",
+ "default": "synthetic-model",
+ "base_url": "http://127.0.0.1:11434/v1",
+ },
+ ],
+)
+def test_fresh_profile_keeps_explicit_builtin_provider_settings(
+ tmp_path, monkeypatch, model
+):
home = tmp_path / ".hermes"
home.mkdir()
monkeypatch.setattr(Path, "home", lambda: tmp_path)
monkeypatch.setenv("HERMES_HOME", str(home))
+ provider = model["provider"]
source = {
- "model": {"provider": "openrouter", "default": "synthetic-model"},
- "providers": {"openrouter": {"request_timeout_seconds": 150}},
+ "model": model,
+ "providers": {provider: {"request_timeout_seconds": 150}},
"_config_version": DEFAULT_CONFIG["_config_version"],
}
atomic_config_write(home / "config.yaml", source)