stage-314 absorb: isolate CODEX_HOME in v0.51.19 codex provider card tests

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.
This commit is contained in:
hermes-agent
2026-05-07 18:09:40 +00:00
parent 2bb9b0e4c2
commit d69d0eb35b
@@ -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():