Conversation
PR #106362 — fix(plugins): follow active chat model for Codex image hostSummary: The Codex Responses host model is no longer pinned to Findings (all Non-blocking):
Verdict: Looks correct with good test matrix (precedence, blank-env fallthrough, wire-body assertion). Safe to merge. |
|
Red-team comparison against #106758 and the original #105398 constraints: this is the better integration path. It reuses the established One residual edge worth considering before merge: the final fallback is still No request to expand scope if that tradeoff is deliberate; the current patch is materially stronger than my later competing one. |
|
Landed in #111000 (3275ca8). The |
What Problem This Solves
plugins/image_gen/openai-codex/__init__.pypinned the Codex Responses host model to_CODEX_CHAT_MODEL = "gpt-5.5", and everyimage_generaterequest rode that id. After OpenAI removedgpt-5.5from a cohort of ChatGPT accounts (2026-09-07, rolling per-account), all image generation on affected accounts 404s permanently — while chat recovers the moment the user switches agent model (e.g. togpt-5.6-luna), because the image lane never followed. The host model was neither configurable nor tracking the active chat model.Changes
_resolve_host_model()(new): precedence explicit →OPENAI_CODEX_CHAT_MODELenv →image_gen.openai-codex.host_model(scoped, profile-resolved via the existingload_image_gen_configloader) → active chat model when Codex-served →gpt-5.5fallback. The id is intentionally unconstrained (no catalog): host availability is per-account._active_codex_chat_model()(new): followsmodel.defaultonly when Codex-served — explicitly Codex-routed providers (codex/openai-codex/chatgpt) trusted verbatim, explicitly non-Codex providers never followed (a Claude id would 404 on the Codex backend), auto/unset routes follow on agpt-/o1/o3/o4/codexid prefix._build_responses_payload()now sends the resolved host model (plus an optionalhost_model=override); single call site, no other callers.image_gen.openai-codex.host_model(closed, unmerged) and folds in theOPENAI_CODEX_CHAT_MODELenv delta its closer asked to carry over — no third competing key scheme. Neither closed PR followed the active chat model (the issue's preference Terminal tool #1); this adds that.image-generation.md.Evidence
TestHostModeltests failed pre-fix (assert 'gpt-5.5' == 'gpt-5.6-luna'), 2 fallback-pinning tests passed throughout.D:/code/hermes-agent/.venv/Scripts/python.exe -m pytest tests/plugins/image_gen/test_openai_codex_provider.py -q→ 35 passed (28 existing + 7 new), no live key (MockTransport asserts the wire bodymodel; realconfig.yamlfiles underHERMES_HOME, no internal monkeypatching of the resolver).ruff checkon both touched Python files: all checks passed.origin/mainstill9e0dc4319a, no rebase needed.Closes #105398