diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e8633515b..b842e16927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ this file. The format follows Keep a Changelog, and versioned releases follow Semantic Versioning where the repository publishes a release. ## [Unreleased] +- Fix two `tests/test_contextual_orchestrator_review_policy.py` tests left broken by merged + `#1587` ("separate free-pool admission from global discovery"), which intentionally excluded + `OPENAI_API_KEY` from `FREE_POOL_CREDENTIAL_NAMES` but did not update + `test_build_catalog_applies_account_cap` and `test_build_catalog_respects_limit`, both of which + still built discovery reports using `openai` rows and asserted they were admitted to the free + pool. Every full-suite/coverage-evidence run on protected `main` (and every PR rebasing onto it) + inherited these two failures regardless of its own diff. Swapped the `openai` rows in both tests + for `bytez` (also `is_free`-eligible but, unlike `openai`, still in `FREE_POOL_CREDENTIAL_NAMES`), + preserving each test's original intent — three distinct provider accounts each capped at 2, and a + single provider's rows truncated to the configured limit — without depending on the now-removed + OpenAI free-pool admission. No production code changed. - **Fix a live crash: `noema-review` failed with an unhandled `HTTPError` instead of failing closed.** Live incident on `ContextualWisdomLab/naruon#1486`: `scripts/ci/noema_review_gate.py::call_llm`'s `opener.open(request)` call sat diff --git a/tests/test_contextual_orchestrator_review_policy.py b/tests/test_contextual_orchestrator_review_policy.py index b10fc4a0b9..089f73a574 100644 --- a/tests/test_contextual_orchestrator_review_policy.py +++ b/tests/test_contextual_orchestrator_review_policy.py @@ -354,7 +354,7 @@ def test_build_catalog_applies_account_cap() -> None: for i in range(6) ] + [ - {"provider": "openai", "model": f"o{i}", "agent_id": f"oa_{i}", "is_free": True, **FREE_PRICE} + {"provider": "bytez", "model": f"b{i}", "agent_id": f"bz_{i}", "is_free": True, **FREE_PRICE} for i in range(3) ] } @@ -367,14 +367,14 @@ def test_build_catalog_applies_account_cap() -> None: account_counts[account] = account_counts.get(account, 0) + 1 assert account_counts["nvidia_nim"] == 2 assert account_counts["nvidia_nim_sub"] == 2 - assert account_counts["openai"] == 2 + assert account_counts["bytez"] == 2 def test_build_catalog_respects_limit() -> None: """The catalog never exceeds the configured agent limit.""" report = { "models": [ - {"provider": "openai", "model": f"m{i}", "agent_id": f"oa_{i}", "is_free": True, **FREE_PRICE} + {"provider": "bytez", "model": f"m{i}", "agent_id": f"bz_{i}", "is_free": True, **FREE_PRICE} for i in range(20) ] }