Skip to content

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

Description

@awsldev

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions