fix: restore zero-arg fetch_models_dev call on default paths

The branched call shape in get_provider_info/get_provider is deliberate:
~69 test sites across tests/hermes_cli and tests/gateway monkeypatch
fetch_models_dev (and get_provider_info) with zero/single-arg lambdas.
Passing allow_network= unconditionally broke 5 tests in CI slices 2/3/7.
Documented the constraint inline.
This commit is contained in:
kshitijk4poor
2026-07-29 16:25:40 +05:00
committed by kshitij
parent 11ca7eedf0
commit ccf7129ed0
3 changed files with 19 additions and 4 deletions
+8 -1
View File
@@ -837,7 +837,14 @@ def get_provider_info(
# Resolve Hermes ID → models.dev ID
mdev_id = PROVIDER_TO_MODELS_DEV.get(provider_id, provider_id)
data = fetch_models_dev(allow_network=allow_network)
# NOTE: keep the zero-argument call on the default path. Dozens of test
# sites monkeypatch fetch_models_dev with zero-arg lambdas; passing the
# kwarg unconditionally would break them all (they raise TypeError).
data = (
fetch_models_dev()
if allow_network
else fetch_models_dev(allow_network=False)
)
raw = data.get(mdev_id)
if not isinstance(raw, dict):
return None