Skip to content

Bug: VSCode extension duplicates config.toml content on startup #9770

@albertodimas

Description

@albertodimas

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

  1. Create a valid ~/.codex/config.toml with MCP servers, features, etc.
  2. Open VSCode with the Codex extension
  3. Close VSCode
  4. Reopen VSCode
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to the VS Code extension

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions