fix(codex): update silent-hang workaround hint

This commit is contained in:
EvilHumphrey 2026-05-26 21:43:42 -07:00 committed by Teknium
parent 976979489a
commit 4243b6dc45
4 changed files with 87 additions and 17 deletions

View file

@ -3,7 +3,8 @@
The helper substitutes an actionable hint into the stale-call timeout
warning when the request matches a known Codex silent-reject pattern
(gpt-5.5 family on the ChatGPT Codex backend). See issue #21444 for
symptom history.
symptom history. The recommended workaround for ChatGPT Codex OAuth
accounts is `gpt-5.4` / `gpt-5.3-codex`, not `gpt-5.4-codex`.
"""
from __future__ import annotations
@ -43,6 +44,8 @@ def test_hint_fires_for_bare_gpt_5_5_on_codex(tmp_path):
agent.api_mode = "codex_responses"
hint = agent._codex_silent_hang_hint(model="gpt-5.5")
assert hint is not None
assert "gpt-5.4" in hint
assert "gpt-5.3-codex" in hint
assert "gpt-5.4-codex" in hint
assert "fallback chain" in hint
@ -72,11 +75,11 @@ def test_hint_fires_when_model_arg_omitted(tmp_path):
# ── negative cases: hint stays None ────────────────────────────────────────
def test_hint_skipped_for_gpt_5_4_codex(tmp_path):
"""gpt-5.4-codex is the recommended workaround — must not trigger."""
agent = _make_agent(tmp_path, model="gpt-5.4-codex")
def test_hint_skipped_for_gpt_5_4(tmp_path):
"""gpt-5.4 is the recommended workaround — must not trigger."""
agent = _make_agent(tmp_path, model="gpt-5.4")
agent.api_mode = "codex_responses"
assert agent._codex_silent_hang_hint(model="gpt-5.4-codex") is None
assert agent._codex_silent_hang_hint(model="gpt-5.4") is None
def test_hint_skipped_for_gpt_5_50_false_positive(tmp_path):
@ -107,11 +110,11 @@ def test_hint_skipped_for_non_codex_provider(tmp_path):
def test_hint_skipped_for_empty_model(tmp_path):
"""Explicit empty string ``model`` short-circuits the regex."""
agent = _make_agent(tmp_path, model="gpt-5.4-codex") # self.model non-matching
agent = _make_agent(tmp_path, model="gpt-5.4") # self.model non-matching
agent.api_mode = "codex_responses"
# Explicit empty string: regex won't match
assert agent._codex_silent_hang_hint(model="") is None
# model=None falls back to self.model which is gpt-5.4-codex, also no match
# model=None falls back to self.model which is gpt-5.4, also no match
assert agent._codex_silent_hang_hint(model=None) is None