VS Code extension doesn't work with custom model
What version of Codex is running?
codex-cli 0.58.0
What subscription do you have?
free
Which model were you using?
GLM-4.5-air
What platform is your computer?
Microsoft Windows NT 10.0.19043.0 x64
What issue are you seeing?
I am using the CodeX for VS Code plugin. After adding a custom model via Config.toml and switching the default model in CodeX CLI, the default model in the plugin still hasn't changed, and the custom model does not appear in the model list. As someone who doesn’t understand code, this is very frustrating. I am really intimidated by command-line interfaces like CodeX CLI.
<img width="444" height="207" alt="Image" src="https://github.com/user-attachments/assets/a1cb6833-f420-40bd-9d47-03b89895a217" />
<img width="243" height="489" alt="Image" src="https://github.com/user-attachments/assets/e106b8ac-0417-4825-908d-ec000b759d35" />
What steps can reproduce the bug?
Modify the Config.toml file with the following content:
model_provider = "custom"
model = "GLM-4.5-air"
model_reasoning_effort = "high"
disable_response_storage = true
windows_wsl_setup_acknowledged = true
[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://open.bigmodel.cn/api/coding/paas/v4"
Add the secret key in the auth.json file
In VS Code, Reload Window
What is the expected behavior?
I would like to be able to select and switch to my custom model within CodeX for VS Code. If that is difficult to implement, then I hope that at the very least, the default model in CodeX for VS Code can be changed to my custom model based on the configuration in the config.toml file, rather than the custom model being completely unusable in the plugin.
Additional information
_No response_
3 Comments
It seems codex plugin does not respect model specified in config.toml. codex plugin will always use gpt-5.1-codex instead. So when I redirect model gpt-5.1-codex to gemini-2.5-flash using litellm proxy, it works.
I forgot to say, the prerequisite for Codex to use config.toml is the auth.json under .codex does not exist.
I experienced similar issues. Config loading is simply inconsistent/failing.
Current config file
Observed behavior in VS Code extension (Custom mode):
The agent reports environment_context as sandbox_mode: workspace-write, network_access: restricted, no approval_policy field, despite config.toml specifying network_access = "enabled" and approval_policy = "never".
Repro steps (suggested for the issue):
Place the above config.toml at C:\Users\brinx\.codex\config.toml.
In VS Code, select the Codex mode “Custom (config.toml)”.
Open a new Codex chat and ask for the current config/environment. Observe it reports network_access: restricted and omits approval_policy, instead of applying the file values.