Repository navigation
fix(codex): stop the model-migration dialog blocking session start - #92
Merged
Merged
Conversation
added 2 commits
August 12, 2026 23:28
Codex CLI shows the "try the new model" dialog unless notice.model_migrations[<model it is about to run>] already points at the exact upgrade target the model catalog advertises (codex-rs/tui/src/app/startup_prompts.rs). Two things broke that: - the acknowledgement was written only when the session pinned a model, while the CLI runs the catalog default when it does not, and - the target was a hardcoded slug (gpt-5.4) that the catalog has since moved past — gpt-5.4 is now itself migrated to gpt-5.6-terra, so the acknowledgement never matched. Build the map from the live catalog instead (cached per account), keep the mappings the CLI ships as an offline fallback, and pre-acknowledge the two remaining flag-gated model prompts. The catalog is also gated by the client_version we send: models carry a minimal_client_version and the endpoint hides the ones an older client cannot run, which is why the gpt-5.6 family never appeared in the default model picker at 0.116.0. Signed-off-by: Alex (Aixle agent) <[email protected]>
Signed-off-by: Alex (Aixle agent) <[email protected]>
aixle-com
Bot
force-pushed
the
feature/codex-model-migration-dialog
branch
from
August 12, 2026 23:28
96f1d59 to
c2843c1
Compare
NOX73
reviewed
Aug 13, 2026
added 5 commits
August 13, 2026 09:17
…alog Addresses PR #92 review feedback. The character class in toml_string held its range endpoints as raw NUL and 0x1f bytes, so git classified the whole file as binary and the review diff was unreadable; they are now \u escapes. A .gitattributes rule marks Ruby sources as text so a stray control byte cannot hide a diff again. The catalog upgrade map is no longer cached: the migration target is exactly the value that must not go stale, and config.toml is written once per container start. Signed-off-by: Alex (Aixle agent) <[email protected]>
Signed-off-by: Alex (Aixle agent) <[email protected]>
Addresses PR #92 review feedback. CodexAdapter spoke HTTP directly in two places: the model-catalog GET to chatgpt.com and the OAuth token POST to auth.openai.com, together with the endpoint/version/client-id constants, form encoding, status branching and JSON parsing. Codex::Api is now the transport layer for both, modelled on the existing Coder::Api: class methods returning parsed Model/Tokens structs, and an error hierarchy (HTTPError/UnauthorizedError/TransportError/TimeoutError/ ParseError) so callers rescue once. 401 gets its own class because it is the one status with a domain meaning — the adapter holds a refresh token and can retry. The adapter keeps only the domain decisions: which models to list, when a rejected token is worth refreshing, how the migration map becomes TOML, and the token-rotation guard. Same endpoints, query param, headers, timeouts and fallbacks — no behaviour change. Signed-off-by: Alex (Aixle agent) <[email protected]>
…l-migration-dialog Signed-off-by: Alex (Aixle agent) <[email protected]>
Minitest/RefutePredicate is enabled in .rubocop.yml (unlike the parked AssertPredicate), so the two negative predicate assertions have to use it. Signed-off-by: Alex (Aixle agent) <[email protected]>
artempartos
added a commit
that referenced
this pull request
Dec 2, 2026
… re-resolve (#976) * fix(deps): bump websocket-driver to 0.9.2 and websocket-extensions to 0.3.0 ActionCable's server-side WebSocket framing. Fixes GHSA-pf93-24xc-xgxc (critical), GHSA-5qm2-87xf-x3ff and GHSA-7c6x-34q5-4g2j (Dependabot alerts #89-#92). 0.9.2 (2026-12-01) also buffers data written before `start`, which is the order ActionCable uses (hijack, then start). Supersedes #965 and #966. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]> * fix(deps): re-resolve cross-spawn to 7.1.2 and tar to 7.5.24 cross-spawn 7.1.x fixes GHSA-ghv9-86vm-4v8m (alert #87, Windows-only; we run eslint on Linux). tar 7.5.24 fixes GHSA-ph3c-p786-j4rp; the alert #88 advisory itself is fixed only in tar 8, which pacote and node-gyp do not accept yet. Lock-only, no manifest change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]> --------- Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
What
Starting a session with the Codex agent no longer stops on the Codex CLI
"try the new model" dialog.
~/.codex/config.tomlis generated byAgents::CodexAdapter#generate_config_toml.The dialog is driven by the CLI's startup check
(
codex-rs/tui/src/app/startup_prompts.rs→should_show_model_migration_prompt):it fires when the model the CLI is about to run has an
upgradeentry in themodel catalog and
notice.model_migrations[<that model>]does not already pointat that exact upgrade target. Two things broke that:
one the CLI runs the catalog default (
config.model.unwrap_or(bootstrap.default_model)),which was never acknowledged.
LATEST_TARGET_MODEL = "gpt-5.4". Thecatalog has moved past it —
gpt-5.4is now itself migrated togpt-5.6-terra(seecodex-rs/models-manager/models.json) — so the writtenmapping never matched and the dialog came back.
How
[notice.model_migrations]is now built from the live model catalog (thesame
/backend-api/codex/modelsresponse the CLI reads): every model thatadvertises an
upgradeis pre-acknowledged, so the suppression holds whetheror not the session pinned a model, and it cannot go stale when OpenAI moves
the target. Cached 6h per account; only non-empty results are cached, so a
transient API failure can't pin an empty map.
FALLBACK_MODEL_MIGRATIONSreplacesLATEST_TARGET_MODELas the offlinefallback (expired token / unreachable API). It mirrors the mappings the CLI
ships in its bundled catalog.
[notice]also pre-acknowledgeshide_gpt5_1_migration_promptandhide_gpt-5.1-codex-max_migration_prompt— the two model prompts the CLI stillgates on a dedicated flag rather than on the migration map.
MODEL_SLUG_FORMAT) are emitted, so a hostile ormalformed slug can't corrupt
config.toml; the CLI compares the parsed TOMLkey, and the suppression shouldn't hinge on escape handling inside a quoted key.
CODEX_CLIENT_VERSION0.116.0 → 0.147.0. The models endpoint gates thecatalog on
client_version(each model carries aminimal_client_version; thegpt-5.6 family needs ≥ 0.144.0), which is why the profile default-model picker
showed no gpt-5.6 entries — the comment on task fix(admin): keep record header actions inside the page #534.
Existing suppression (trust dialog, full-access warning, rate-limit model nudge)
is unchanged.
Testing
docker compose -f docker-compose.ci.yml run --rm --no-deps web make check_all(backend: rails test + rubocop + brakeman; frontend: eslint + tsc + vitest).
New cases in
test/services/agents/codex_adapter_test.rb:catalog-default case);
hide_full_access_warning,hide_rate_limit_model_nudge, bothhide_*_migration_promptkeys, projecttrust) stay set;
auth_setup_filesstill writes a pre-authconfig.tomlwithout calling themodels API;
client_versionnew enough for the currentcatalog, and list-visible gpt-5.6 models come back mapped.
Known limitation
config_filesonly receives the credential hash, not theAgentCredentialrecord, so a 401 here can't refresh the token the way
fetch_available_models(credential:)does — it falls back to the static mapinstead. Plumbing the record through
AgentCredentialsService#write_to_containerwould touch every adapter and is out of scope for this fix.
Task: #534
🤖 Generated with Claude Code