codexmate icon indicating copy to clipboard operation
codexmate copied to clipboard

Invalid config.toml is silently masked as a virtual default config instead of surfacing a parse error

Open awsldev opened this issue 8 months ago • 0 comments

Impact Scope

  • CLI commands such as status and list
  • Web/API state reads that rely on config-loading fallback behavior
  • Troubleshooting and automation workflows that rely on accurate error reporting and exit codes

Reproduction Steps

  1. Create a malformed config file:
    tmp=$(mktemp -d)
    mkdir -p "$tmp/.codex"
    cat > "$tmp/.codex/config.toml" <<'EOF2'
    model_provider = "openai"
    model = "gpt-5.3-codex"
    [model_providers.bad name]
    name = "bad name"
    EOF2
    
  2. Run:
    HOME=$tmp USERPROFILE=$tmp node cli.js status
    HOME=$tmp USERPROFILE=$tmp node cli.js list
    
  3. Observe the command output and exit code.

Expected Result

  • The tool should clearly report that config.toml exists but is invalid.
  • The parse error should be surfaced to the user.
  • CLI exit code should be non-zero so scripts/CI can detect the failure.

awsldev avatar Mar 20 '26 14:03 awsldev