Support per-TUI instance model selection
What variant of Codex are you using?
CLI
What feature would you like to see?
Currently, the selected model appears to be reloaded between sessions, so changing the model in one TUI instance can affect new sessions created in another already-running TUI instance.
I do not think this behavior is useful. A TUI instance should read config.toml when it starts, then keep its model selection local for the lifetime of that TUI. New sessions inside the same TUI should use that TUI’s current model, not a model changed elsewhere.
A possible implementation would be an opt-in mode such as codex --local, where model changes stay local to that TUI instance and are not written back to the global config.
This would allow multiple TUI instances to use different models independently, for example, one terminal using 5.4-mini for lighter tasks and another using 5.5 for more complex work.
Additional information
similar issue: #14540
4 Comments
Active sessions retain their current model selection until changed. If you modify the model selection in any TUI instance, that selection is persisted back to the config file, and newly-created sessions will use the last-persisted selection by default. Is that consistent with what you're seeing? You mentioned "the same model is automatically set in every other session", which makes it sound like you're seeing the model selection change for active sessions. I just want to make sure that's not the case.
@etraut-openai Exactly, I misspoke earlier. Existing active sessions keep their selected model. The behavior I’m seeing is that every new session starts with the model last changed by any session in any TUI instance.
I think the linked issue is only loosely related: it asks for model selection to be session-scoped, while I’d like to keep the current global persistence as the default.
What I’m proposing is an additional TUI-instance-scoped mode, something like
codex --local. In that mode, each TUI instance would read from config.toml when it starts, but model changes (or any changes really) inside that TUI would remain local to that TUI instance. They would not be written back to the global config, and the instance would not re-read config.toml after startup.Alternatively, a simpler version might be: reload config.toml only at TUI startup, not between sessions inside the same TUI instance.
That way, the current global-persistence behavior stays the default, while users who want isolated TUI instances can opt into it.
Updated the issue title and description to better reflect my proposal.
@pawel-mackiewicz, thanks for the clarification. I think this overlaps #26472. Please upvote that feature request. If you think it doesn't quite capture your idea, feel free to post to that thread.