Skip to content
FunCoding

Codex model discovery

Codex app-server model discovery, offline hints, and catalog rules

How the Codex model catalog is discovered, and what happens when discovery fails. Part of the Codex harness reference; Where each section moved lists every section.

Model discovery

By default, the Codex plugin asks the app-server for available models. Model availability is owned by Codex app-server, so the list can change when OpenClaw upgrades the bundled @openai/codex version, when OpenClaw selects a newer installed Codex, or when a deployment points appServer.command at a different Codex binary. Availability can also be account-scoped. Use /codex models on a running gateway to see the live catalog for that harness and account.

The OpenAI provider's ChatGPT subscription list is separate. It sends the same OpenClaw version used by Responses requests as client_version. If that version is unavailable or is not a calendar version with a four-digit year of 2026 or later, it sends 99.0.0 instead. Only the numeric release is sent: 2026.11.5-beta.1 lists as 2026.11.5. Labels such as dev, beta, and unknown, and 0.0.0, use the fallback. Listing does not query npm or depend on the bundled or installed Codex version. An empty list from ChatGPT counts as a failed listing, so the last listed models stay.

New OpenAI models can require a newer Codex version than the binary your Codex harness runs. For example, GPT-6.2 requires Codex 0.166.0. A Codex-harness turn on such a model fails and tells you to update your global Codex with npm i -g @openai/codex and restart the Gateway; OpenClaw then selects the newer installed Codex. In Control UI, Start a new session on that failure opens a session on the OpenClaw harness that asks the agent to run the update. The OpenClaw harness runs these models without a Codex update.

Automatic discovery and hosted-search model selection use visible picker entries. Bounded turns with an explicit model selection, including image understanding, structured extraction, isolated completion, and settled-turn finalization, also look up hidden entries returned by model/list. The model must still be listed and support the required input modalities. Listing does not prove account entitlement.

Native discovery is demand-driven. Gateway startup publishes configured model hints without starting an app-server for each agent. The default agent keeps its background catalog warmup when it has a configured primary model, an explicit runtime policy, or a prepared credential for its default provider. An empty installation's built-in fallback model does not trigger that warmup. Opening an agent's model picker or catalog, creating a Codex session, running a turn, or requesting native auth/status information starts that agent's client when needed. Before discovery, native account readiness is unknown; configured hints are not proof of sign-in. First use of an idle agent can take a few seconds for the cold start.

Discovery reads model/list and account/read from the same scoped app-server client. An API-key account remains API-key authentication; model listing does not imply a ChatGPT transport or endpoint. Picker readiness is valid only while that native owner and its account/config observation remain current. A missing account, failed refresh, account/config mutation, or retired client leaves native models unavailable until discovery succeeds again. The next picker/catalog request or native execution reacquires retired observations.

A client with no owned work retires after five idle minutes. Periodic discovery and background turns reuse the same client within that window. Background turns release their own thread and MCP resources without retiring the shared process; strict one-shot CLI runs still close their unclaimed client. Active requests, turns, retained or releasing threads, native children, background terminals, and ephemeral history retain their client until their owners release it. The existing warm-session executor and thread-retention policies remain in effect. Clients and accounts stay isolated by agent home.

Use the Models page Refresh action (models.list with view: "all" and refresh: true) to publish the full catalog for the selected agent. Prepared-only reads do not start discovery. Native configuration changes outside OpenClaw require the native owner's supported reload/restart and a catalog refresh; OpenClaw does not poll native home files for readiness. Authored host routes and explicit profile selections retain their existing auth and compatibility checks.

For the Codex runtime, the composer shows Ultrafast only when authenticated account discovery advertises that service tier for the selected model, account, route, and runtime. The OpenAI provider's existing account-scoped discovery supplies this observation; static catalog hints and the native app-server's fallback list do not establish access. Selecting a managed personal account prepares that account's catalog through the same provider discovery path, without changing shared auth order. Prepared-only reads do not start discovery. Account changes, failed discovery, and retired generations cannot reuse another account's tier support.

Native-only accounts without managed discovery credentials, token-sharing auth that cannot use model discovery, and catalogs without explicit service-tier metadata leave this capability unknown. The composer hides Ultrafast in those cases rather than offering a disabled option. Discovery support describes availability, not a guarantee that an upstream request will receive that tier.

The embedded OpenClaw runtime uses the available API-key OpenAI Responses route to offer Ultrafast without catalog metadata, whether the key comes from an auth profile, environment, or provider config (including SecretRefs). This remains subject to observed provider downgrades for the selected credential and route; see Fast mode. Codex-runtime Ultrafast with API-key authentication still requires the native catalog, including a pinned model_catalog_json, to list the tier for that model.

Native catalog identifiers are runtime identifiers, not privacy labels. A deployment using a broker-owned alias must supply an alias-safe native catalog before starting app-server: both id and model in model/list must be the alias, with the desired displayName. Different native runtime identifiers are preserved in OpenClaw model parameters. Renaming the picker label does not hide those identifiers from requests or session state.

Codex's startup model_catalog_json setting can supply a native catalog; a per-thread override does not reload it. Preserve the complete model capability, instruction, compaction, and reviewer metadata. Catalog membership does not reject arbitrary model overrides, so the broker must enforce allowed selectors on every request. Disable native session discovery with sessionCatalog.enabled: false when no native history should be imported.

A custom endpoint is not automatically a supported Codex route. Explicit agentRuntime.id: "codex" does not bypass prepared-route compatibility or the trusted-endpoint requirement for model-backed approval review. A workload API key also does not provide ChatGPT account identity or subscription refresh. Verify those contracts before using a broker with the native harness; do not substitute a custom provider, remove safety metadata, or weaken review to make an inference smoke test pass.

If discovery is temporarily unavailable or times out, the subscription route uses offline hints derived from the bundled OpenAI model manifest, with Codex plugin fallbacks for gpt-5.5 and gpt-5.5-pro reasoning efforts:

Model idDisplay nameReasoning efforts
gpt-5.6-solGPT-5.6 Sollow, medium, high, xhigh, max
gpt-5.5GPT-5.5low, medium, high, xhigh
gpt-5.5-progpt-5.5-promedium, high, xhigh

Offline hints never prove account entitlement. An authenticated discovery response remains authoritative even if it contains no visible models; HTTP 401 and 403 return an empty catalog rather than exposing fallback models.

The bundled harness is @openai/codex 0.172.0, which exceeds the reported GPT-6.2 minimum version. On November 25, 2026, an unauthenticated model/list check with this version returned 11 visible entries and one default. Authenticated catalogs can differ. Run /codex models after starting or upgrading the Gateway to see the picker for your account. OpenClaw does not change existing configured model selections on upgrade.

OpenClaw reasoning controls preserve supported native levels, including ultra. Codex owns Ultra's proactive delegation and model-specific inference effort; Platform API effort metadata does not downgrade the selected runtime mode.

Tune discovery under plugins.entries.codex.config.discovery:

The default budget is 10 seconds. It allows Codex's five-second remote catalog refresh to finish or return its native cached/bundled catalog, with time left for transport and the account read. Setting a shorter budget can cancel that native fallback and leave native models unavailable until discovery succeeds.

{
  plugins: {
    entries: {
      codex: {
        enabled: true,
        config: {
          discovery: {
            enabled: true,
            timeoutMs: 10000,
          },
        },
      },
    },
  },
}

Disable discovery to avoid native model/account catalog checks even on demand:

{
  plugins: {
    entries: {
      codex: {
        enabled: true,
        config: {
          discovery: {
            enabled: false,
          },
        },
      },
    },
  },
}