codexmate
codexmate copied to clipboard
Web API add-provider accepts invalid provider names and can write invalid TOML table keys
Impact Scope
- Web UI /
/apiprovider management flow ~/.codex/config.tomlpersistence- Config-dependent commands and pages such as
statusandlist
Reproduction Steps
- Start codexmate with a clean home directory:
tmp=$(mktemp -d) HOME=$tmp USERPROFILE=$tmp node cli.js run - Call the Web API to add a provider whose name contains a space:
curl -X POST http://127.0.0.1:3737/api \ -H 'Content-Type: application/json' \ -d '{"action":"add-provider","params":{"name":"bad name","url":"https://api.example.com/v1","key":"sk-test"}}' - Inspect the generated config file:
cat "$tmp/.codex/config.toml" - Run:
HOME=$tmp USERPROFILE=$tmp node cli.js status
Expected Result
- The API should reject invalid provider names with a clear validation error.
config.tomlshould remain valid and parseable.