From e69dc2d929b8a9959527a08a020d47a1108093a3 Mon Sep 17 00:00:00 2001 From: FT_IOxCS <237263164+ft-ioxcs@users.noreply.github.com> Date: Tue, 23 Jun 2026 21:00:27 +0300 Subject: [PATCH] fix: accept Fireworks account model ids in doctor --- hermes_cli/doctor.py | 10 ++++++ tests/hermes_cli/test_doctor.py | 56 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/hermes_cli/doctor.py b/hermes_cli/doctor.py index 7aadc58f5f256..fd1833833291e 100644 --- a/hermes_cli/doctor.py +++ b/hermes_cli/doctor.py @@ -824,11 +824,21 @@ def run_doctor(args): or provider_policy_id == "custom" or provider_policy_id.startswith("custom:") ) + # Fireworks native model IDs use a multi-segment path shape such as + # ``accounts/fireworks/models/qwen3p7-plus``. That contains slashes, + # but it is not an aggregator-style ``vendor/model`` slug and is + # valid for the native Fireworks provider. + is_native_fireworks_model_id = ( + provider_policy_id == "fireworks" + and default_model.startswith("accounts/") + and "/models/" in default_model + ) if ( default_model and "/" in default_model and provider_policy_id and not provider_accepts_vendor_slug + and not is_native_fireworks_model_id ): check_warn( f"model.default '{default_model}' uses a vendor/model slug but provider is '{provider_raw}'", diff --git a/tests/hermes_cli/test_doctor.py b/tests/hermes_cli/test_doctor.py index 11b6033844fd4..6697cffd8d01e 100644 --- a/tests/hermes_cli/test_doctor.py +++ b/tests/hermes_cli/test_doctor.py @@ -540,6 +540,62 @@ def test_run_doctor_accepts_hermes_provider_ids_that_catalog_aliases( ) +def test_run_doctor_accepts_native_fireworks_account_model_ids(monkeypatch, tmp_path): + home = tmp_path / ".hermes" + home.mkdir(parents=True, exist_ok=True) + (home / ".env").write_text("FIREWORKS_API_KEY=***\n", encoding="utf-8") + (home / "config.yaml").write_text( + "model:\n" + " provider: fireworks\n" + " default: accounts/fireworks/models/qwen3p7-plus\n", + encoding="utf-8", + ) + + monkeypatch.setattr(doctor_mod, "HERMES_HOME", home) + monkeypatch.setattr(doctor_mod, "PROJECT_ROOT", tmp_path / "project") + monkeypatch.setattr(doctor_mod, "_DHH", str(home)) + (tmp_path / "project").mkdir(exist_ok=True) + + fake_model_tools = types.SimpleNamespace( + check_tool_availability=lambda *a, **kw: ([], []), + TOOLSET_REQUIREMENTS={}, + ) + monkeypatch.setitem(sys.modules, "model_tools", fake_model_tools) + + try: + from hermes_cli import auth as _auth_mod + monkeypatch.setitem( + _auth_mod.PROVIDER_REGISTRY, + "fireworks", + _auth_mod.ProviderConfig( + id="fireworks", + name="Fireworks AI", + auth_type="api_key", + api_key_env_vars=("FIREWORKS_API_KEY",), + ), + ) + monkeypatch.setattr(_auth_mod, "get_nous_auth_status", lambda: {}) + monkeypatch.setattr(_auth_mod, "get_codex_auth_status", lambda: {}) + monkeypatch.setattr(_auth_mod, "get_xai_oauth_auth_status", lambda: {}) + monkeypatch.setattr(_auth_mod, "get_auth_status", lambda provider: {"configured": True}) + except Exception: + pass + + buf = io.StringIO() + with contextlib.redirect_stdout(buf): + doctor_mod.run_doctor(Namespace(fix=False)) + + out = buf.getvalue() + assert "model.provider 'fireworks' is not a recognised provider" not in out + assert "model.provider 'fireworks' is unknown" not in out + assert ( + "model.default 'accounts/fireworks/models/qwen3p7-plus' uses a vendor/model slug " + "but provider is 'fireworks'" + not in out + ) + assert "Either set model.provider to 'openrouter', or drop the vendor prefix." not in out + + def test_run_doctor_accepts_vendor_slugs_for_named_custom_provider(monkeypatch, tmp_path): home = tmp_path / ".hermes" home.mkdir(parents=True, exist_ok=True)