codexmate
codexmate copied to clipboard
Invalid config.toml is silently masked as a virtual default config instead of surfacing a parse error
Impact Scope
- CLI commands such as
statusandlist - 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
- 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 - Run:
HOME=$tmp USERPROFILE=$tmp node cli.js status HOME=$tmp USERPROFILE=$tmp node cli.js list - Observe the command output and exit code.
Expected Result
- The tool should clearly report that
config.tomlexists 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.