From d69d0eb35b7f5156495fbb676baefb03f043b8be Mon Sep 17 00:00:00 2001 From: hermes-agent Date: Thu, 7 May 2026 18:09:40 +0000 Subject: [PATCH] stage-314 absorb: isolate CODEX_HOME in v0.51.19 codex provider card tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #1827 introduced _read_visible_codex_cache_model_ids() merging into the providers card live-fetch path. The two v0.51.19 tests in tests/test_issue1807_codex_provider_card_live_models.py predate that helper and didn't isolate CODEX_HOME, so the dev machine's real ~/.codex/models_cache.json (which contains entries like gpt-5.3-codex-spark from #1680) was leaking into their assertions. Add CODEX_HOME isolation in the existing _configure_codex helper — matches the pattern PR #1827's own test already uses. Test-only fix; production code unchanged. Caught by pre-release pytest gate. --- tests/test_issue1807_codex_provider_card_live_models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_issue1807_codex_provider_card_live_models.py b/tests/test_issue1807_codex_provider_card_live_models.py index ed734d91..da678979 100644 --- a/tests/test_issue1807_codex_provider_card_live_models.py +++ b/tests/test_issue1807_codex_provider_card_live_models.py @@ -35,6 +35,14 @@ def _configure_codex(monkeypatch, tmp_path): "fallback_providers": [], }) monkeypatch.setattr(config, "_cfg_mtime", 0.0) + # Isolate the Codex local model cache so the dev machine's real + # ~/.codex/models_cache.json (which may include account-specific entries + # like gpt-5.3-codex-spark) doesn't leak into these tests. Stage-314 + # added _read_visible_codex_cache_model_ids() merging via PR #1827, so + # CODEX_HOME isolation is now load-bearing for these v0.51.19 tests. + codex_home = tmp_path / "no-codex" + codex_home.mkdir() + monkeypatch.setenv("CODEX_HOME", str(codex_home)) def _codex_provider():