[codex] Add OpenAI Responses fallback for mini models#784
Draft
nyldn wants to merge 1 commit into
Draft
Conversation
safishamsi
requested changes
May 9, 2026
Owner
safishamsi
left a comment
There was a problem hiding this comment.
Two issues to fix before merging:
1. _call_llm not updated for Responses API routing
extract_files_direct routes GPT-5/codex-mini to _call_openai_responses, but _call_llm (used by the dedup tiebreaker path) still routes everything through _call_openai_compat. GPT-5 users hitting the dedup path will get API errors. _call_llm needs the same if model in RESPONSES_API_MODELS branch.
2. Replace assert last_exc is not None with an explicit raise
# instead of:
assert last_exc is not None
raise last_exc
# use:
if last_exc is None:
raise RuntimeError("retry loop exited without exception")
raise last_excassert is silently removed under python -O, which would cause an UnboundLocalError on last_exc in optimized builds.
Fix these two and CI passes → ready to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--backend openai --model ...orGRAPHIFY_OPENAI_MODELGRAPHIFY_OPENAI_FALLBACK_MODELS, preserving the existinggpt-4.1-minidefault and Chat Completions pathgpt-5.5-miniwith fallback togpt-5.4-mini,gpt-4.1-miniScope / duplication check
openai codex mini fallback gpt-5.5 gpt-5.4; no matching open item came back.Validation
uv run --with pytest pytest tests/test_llm_backends.py tests/test_ollama.py -q-> 18 passedpython3 -m compileall graphify/llm.py graphify/__main__.py-> passeduv run graphify --help | sed -n '/extract <path>/,+8p'-> verified help textgraphify update .-> completed code graph refreshuv run --with pytest pytest -q-> 667 passed, 6 failed in existing Fortran/SQL parser tests unrelated to this backend change (test_fortran_capital_F_parses_preprocessed, SQL table/view/function/edge assertions)