Skip to content

Feature: ability to reload model_catalog_json in a running app-server / Desktop without restart #49930

Open

Description

@arikon

What variant of Codex are you using?

Codex App (macOS desktop, bundled CLI 0.159.0), also applies to any long-running codex app-server / TUI session

What feature would you like to see?

A supported way to make a running app-server (and the Desktop model picker) re-read model_catalog_json without restarting the process.

Motivation. model_catalog_json is a documented integration point for proxies and custom providers (we run a local routing proxy that rewrites the catalog file when its provider table changes). Today the catalog is captured in memory at process start and nothing can refresh it:

  • StaticModelsManager is built once from config.model_catalog at startup (codex-rs/app-server/src/message_processor.rs via build_models_manager, codex-rs/core/src/thread_manager.rs) and StaticModelsManager::raw_model_catalog ignores every RefreshStrategy (codex-rs/models-manager/src/manager.rs).
  • reload_user_config (the hot-reload path behind config/batchWrite with reloadUserConfig: true) rebuilds Config objects for loaded threads, but ThreadManager.state.models_manager is never replaced, so the picker keeps serving the startup catalog.
  • The background ModelsRefreshWorker (every 4.5 min) calls list_models(RefreshStrategy::Online), which is a no-op for the static manager.
  • There are no POSIX-signal handlers for config/catalog reload (only SIGINT/SIGTERM shutdown in codex-rs/app-server-transport/src/transport/stdio.rs).

Live experiment confirming the gap. We started an app-server pointed at a 26-model catalog, then updated the same file to 30 models (4 new) and called config/batchWrite with edits: [] and reloadUserConfig: true. The RPC returned status: ok (config reload succeeded, config.toml untouched), but model/list still returned 26 models and none of the new ones. New threads did not see the new models either, because session model resolution goes through the same captured manager (codex-rs/core/src/session/mod.rs).

What we currently have to do: fully restart the Desktop app (or the daemon) after every catalog change. Short-lived processes (codex exec, fresh TUI connections) pick up the new file immediately, which makes the staleness confusing to diagnose — behavior differs per surface.

Proposals (any one would unblock us):

  1. An app-server RPC such as model/catalog/reload that rebuilds the models manager from the current model_catalog_json and pushes a picker-update notification to connected clients.
  2. A file watcher / mtime check on the catalog path consulted by model/list (perhaps gated behind a config flag).
  3. Making StaticModelsManager honor a RefreshStrategy::Online by re-reading the file, so the existing ModelsRefreshWorker picks changes up within its 4.5-minute interval.

Additional information

Related existing issues that describe symptoms of the same root cause, from different angles:

All of these would be mitigated by a reload capability; today the only remediation is a process restart, which is hard to automate for a desktop app and easy to forget.

Activity

  1. added
    enhancement
    app
    app-server
    custom-model
    on Oct 1, 2026
  2. MaiHoangViet1809 commented on Oct 27, 2026

    @MaiHoangViet1809

    Also seeing this when using codex-router on macOS with the Desktop-bundled runtime 0.164.0-alpha.11.1.

    The router updates the valid JSON file referenced by model_catalog_json, but the running app-server keeps returning the previous list from model/list.

    In an isolated reproduction:

    1. Start app-server with a catalog containing 17 models.
    2. Update that same file to contain 18 models.
    3. Call model/list again: it still returns 17 models.
    4. Start a new app-server process with the updated file: all 18 models appear.

    config/batchWrite with reloadUserConfig: true did not refresh the list in the existing process either.

    It would be helpful if changes to the custom catalog were picked up automatically and reflected in the Desktop model picker, without restarting Codex. This would let router integrations keep the available model list current as providers add or update models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appapp-servercustom-modelenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions