Current Behavior
The coder-labs/codex module writes its configuration to $HOME/.codex/config.toml, even when CODEX_HOME points to another directory.
Codex reads its user configuration from $CODEX_HOME/config.toml. As a result, the module can finish successfully while writing settings that the CLI does not use. This affects workspaces that store Codex state in a custom or persistent directory: the module's model settings, MCP servers, trusted projects and AI Gateway configuration are written to the wrong location.
Steps to Reproduce
- Set
CODEX_HOME=/home/coder/state/codex in the environment used by both the module's install script and the Codex CLI.
- Create that directory and a
config.toml containing model_reasoning_effort = "high".
- Configure the module with
base_config_toml = "model_reasoning_effort = \"medium\"" and start the workspace.
- Check both configuration files:
$HOME/.codex/config.toml contains the module's medium setting, while $CODEX_HOME/config.toml still contains high.
Expected Behavior
The module should write its configuration under CODEX_HOME when it is set to a non-empty value, and use $HOME/.codex otherwise.
Currently, populate_config_toml() hardcodes the default path rather than following Codex's configuration directory.
Current Behavior
The
coder-labs/codexmodule writes its configuration to$HOME/.codex/config.toml, even whenCODEX_HOMEpoints to another directory.Codex reads its user configuration from
$CODEX_HOME/config.toml. As a result, the module can finish successfully while writing settings that the CLI does not use. This affects workspaces that store Codex state in a custom or persistent directory: the module's model settings, MCP servers, trusted projects and AI Gateway configuration are written to the wrong location.Steps to Reproduce
CODEX_HOME=/home/coder/state/codexin the environment used by both the module's install script and the Codex CLI.config.tomlcontainingmodel_reasoning_effort = "high".base_config_toml = "model_reasoning_effort = \"medium\""and start the workspace.$HOME/.codex/config.tomlcontains the module'smediumsetting, while$CODEX_HOME/config.tomlstill containshigh.Expected Behavior
The module should write its configuration under
CODEX_HOMEwhen it is set to a non-empty value, and use$HOME/.codexotherwise.Currently,
populate_config_toml()hardcodes the default path rather than following Codex's configuration directory.