Description
The VSCode Codex extension appends the entire config.toml content to itself every time VSCode starts or restarts, causing TOML parse errors due to duplicate keys.
Environment
- VSCode Extension version: 0.5.63
- Codex CLI version: 0.89.0
- OS: Ubuntu 24.04 Linux
- VSCode: Insiders 1.97.x
Steps to Reproduce
- Create a valid
~/.codex/config.toml with MCP servers, features, etc.
- Open VSCode with the Codex extension
- Close VSCode
- Reopen VSCode
- Check
~/.codex/config.toml - the entire content is duplicated (appended to itself)
Error Message
Invalid configuration; using defaults.
Error parsing config file /home/user/.codex/config.toml: TOML parse error at line 61, column 2 | [features] | ^^^^^^^^ duplicate key
Actual Behavior
Every VSCode restart appends the full config.toml content again, resulting in:
- First restart: 2x content
- Second restart: 3x content (or more)
- File grows from ~1.5KB to 10KB+
Expected Behavior
config.toml should not be modified on VSCode startup. The extension should only read the config, not write/append to it.
Workaround
Setting the file to read-only (chmod 444 ~/.codex/config.toml) prevents the duplication but may block some features like "experimental features" updates.
Additional Context
- The bug started appearing around extension version 0.5.60+
- Happens consistently on every VSCode restart
- Only affects VSCode extension, not the CLI directly
Description
The VSCode Codex extension appends the entire config.toml content to itself every time VSCode starts or restarts, causing TOML parse errors due to duplicate keys.
Environment
Steps to Reproduce
~/.codex/config.tomlwith MCP servers, features, etc.~/.codex/config.toml- the entire content is duplicated (appended to itself)Error Message
Actual Behavior
Every VSCode restart appends the full config.toml content again, resulting in:
Expected Behavior
config.tomlshould not be modified on VSCode startup. The extension should only read the config, not write/append to it.Workaround
Setting the file to read-only (
chmod 444 ~/.codex/config.toml) prevents the duplication but may block some features like "experimental features" updates.Additional Context