codexmate icon indicating copy to clipboard operation
codexmate copied to clipboard

Web API add-provider accepts invalid provider names and can write invalid TOML table keys

Open awsldev opened this issue 8 months ago • 0 comments

Impact Scope

  • Web UI / /api provider management flow
  • ~/.codex/config.toml persistence
  • Config-dependent commands and pages such as status and list

Reproduction Steps

  1. Start codexmate with a clean home directory:
    tmp=$(mktemp -d)
    HOME=$tmp USERPROFILE=$tmp node cli.js run
    
  2. 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"}}'
    
  3. Inspect the generated config file:
    cat "$tmp/.codex/config.toml"
    
  4. Run:
    HOME=$tmp USERPROFILE=$tmp node cli.js status
    

Expected Result

  • The API should reject invalid provider names with a clear validation error.
  • config.toml should remain valid and parseable.

awsldev avatar Mar 20 '26 14:03 awsldev