Codex could automatically use different models based on task type

Open 💬 0 comments Opened Jan 14, 2026 by saidelike

What feature would you like to see?

Leading agentic coding tools enable configurable model selection for different task types executed by the agent; Codex would benefit from adopting a similar approach.

Enable configuration of defaults via environment variables:

  • model_reasoning: the model for complex reasoning and architecture decisions (e.g. gpt-5.2)
  • model_execution: the model for code generation and implementation (e.g. gpt-5)
  • model_tool: the model for tool execution or background functionality (e.g. gpt-4.1)

By default, in plan mode, Codex would automatically use model_reasoning for complex reasoning and architecture decisions and use model_tool for efficient execution of tools (find, grep, etc.). By delegating tool execution to the more efficient model and reasoning to the stronger model, we get the best of all worlds for efficient, speed and cost.

Support hybrid settings (e.g., gptplan), which use a stronger model (model_reasoning) for planning (still using model_tool when appropriate), then switch to a more efficient model (model_execution) for execution (still using model_tool when appropriate).

So in ~/.codex/config.toml:

model               ="gpt-5.2"
#model              = "gptplan" # alternative hybrid
model_reasoning     ="gpt-5.2"
model_execution     ="gpt-5"
model_tool          ="gpt-4.1"

This would be even beneficial with the plan mode described in https://github.com/openai/codex/discussions/7355 and tracked in https://github.com/openai/codex/issues/2101

Additional information

_No response_

View original on GitHub ↗