Skip to content

The agent that grows with you

test: fold the named providers: pin case into the custom-endpoint parametrize

kshitijk4poor34ad35e474e5
diff --git a/tests/hermes_cli/test_resolve_provider_custom_endpoint.py b/tests/hermes_cli/test_resolve_provider_custom_endpoint.py
index d1f2d21bb2e..834561e72db 100644
--- a/tests/hermes_cli/test_resolve_provider_custom_endpoint.py
+++ b/tests/hermes_cli/test_resolve_provider_custom_endpoint.py
@@ -61,6 +61,15 @@ def isolated_home(tmp_path, monkeypatch):
"openrouter",
id="provider-openrouter-mirror",
),
+ # A bare ``model.provider`` naming a ``providers:`` entry is explicit intent too:
+ # has_named_custom_provider() already routes it at runtime (``hermes chat`` works), so the
+ # boot inventory must not discard the bare name.
+ pytest.param(
+ "model:\n default: test-model\n provider: CPA\n\n"
+ "providers:\n CPA:\n api: http://127.0.0.1:8317/v1\n default_model: test-model\n",
+ "custom",
+ id="named-providers-pin",
+ ),
],
)
def test_configured_custom_endpoint_resolves_as_a_provider(isolated_home, model_block, expected):
@@ -75,28 +84,6 @@ def test_configured_custom_endpoint_resolves_as_a_provider(isolated_home, model_
assert record.inference_provider == expected
-def test_named_provider_pin_resolves_as_a_provider(isolated_home):
- """A bare ``model.provider`` naming a ``providers:`` entry is explicit intent too.
-
- Sibling of the openrouter rung above: ``has_named_custom_provider()`` already routes this
- config at runtime (``hermes chat`` works against ``providers.CPA``), but the boot inventory
- discarded the bare name, so ``setup.status`` reported ``provider_configured: False`` and the
- dashboard parked sessions on Setup Required for a working endpoint.
- """
- (isolated_home / "config.yaml").write_text(
- "model:\n default: test-model\n provider: CPA\n\n"
- "providers:\n CPA:\n api: http://127.0.0.1:8317/v1\n default_model: test-model\n",
- encoding="utf-8",
- )
- from hermes_cli.auth import resolve_provider
- from hermes_cli.free_tier_bootstrap import run_bootstrap
-
- assert resolve_provider("auto") == "custom"
- record = run_bootstrap(announce=False)
- assert record.provider_configured is True
- assert record.other_providers is True
-
-
def test_stale_remote_base_url_without_a_custom_pin_is_not_a_provider(isolated_home):
"""The URL rung follows the runtime's own trust rule: a non-loopback ``base_url`` left behind
under a bare (unpinned) provider is not custom intent (#14676), so a blank machine still reads