fix(auth): self-heal missing Codex access tokens

Recover Codex singleton auth entries that have a refresh token but no access token by adopting a valid Codex CLI token pair, matching the cron-time failure mode before falling back to the credential pool.
This commit is contained in:
Teknium
2026-06-13 05:15:26 -07:00
parent 311ff967de
commit aa0798352a
3 changed files with 112 additions and 17 deletions
@@ -76,6 +76,7 @@ def test_resolve_codex_runtime_credentials_missing_access_token(tmp_path, monkey
hermes_home = tmp_path / "hermes"
_setup_hermes_auth(hermes_home, access_token="")
monkeypatch.setenv("HERMES_HOME", str(hermes_home))
monkeypatch.setenv("CODEX_HOME", str(tmp_path / "missing-codex"))
with pytest.raises(AuthError) as exc:
resolve_codex_runtime_credentials()