Skip to main content

Module codex_models

Module codex_models 

Source
Expand description

The models a Codex account can use, from the list the Codex CLI fetches from OpenAI and caches in $CODEX_HOME/models_cache.json. AgentMux’s own list went stale: on 2026-10-22 OpenAI no longer accepted any model it offered for a ChatGPT account. Read locally, no network call. SPEC_CODEX_OAUTH_IN_CONNECTORS_AND_EMAIL_LABELS_2026_10_22.md §4.

Constants§

MODELS_CACHE_FILE
The cache file’s name in a Codex config dir.

Functions§

codex_dirs
Every account’s Codex config dir: <identities>/<account>/<auth_dir_name>. Not the old shared provider dir (shared/providers/codex): no account uses it, and its auth.json without a model list made the common list unknown for good, so Codex panes got no --model and the curated menu (AgentA, found testing #5323).
forget_models_on_sign_in
A sign-in is starting in this Codex config dir: drop its cached model list. A reconnect may be another ChatGPT account or plan, and the old list would otherwise stand for it until the CLI fetches a new one; without it the account’s models are unknown, so a pane passes no --model and the CLI picks one the account offers.
installed_common_model_ids
The ids every Codex account on this install lists, in order: what a pane srv opens itself (agent.open) may start on. Empty when no account has a list yet, when data paths can’t be resolved, and always in tests, so a test never reads this machine’s real accounts.
models_every_account_lists
The models every Codex account here can run: those listed in each account’s cache, in the order of the most recently fetched one. The menu and a new pane’s default are shared by all Codex panes, so offering one account’s list would let a pane bound to another account (a different plan) pick a model it can’t run. Empty when no account has a list yet (a fresh sign-in before its first turn) or the lists share nothing; the frontend then keeps its curated list. A signed-in account (an auth.json) without a list yet makes the common list unknown too: the others’ list might not suit it. Directories with neither (another provider’s account) are ignored.