Files
OmniRoute/changelog.d/fixes/opencode-force-cli-ua.md

782 B

  • fix(providers): when OPENCODE_SYNTHESIZE_CLI_HEADERS=true, a non-CLI client User-Agent (e.g. curl/8.5.0, SDKs) on opencode-go/opencode-zen/opencode-free requests is now REPLACED with the synthesized opencode-cli/1.0.0 instead of being honored — opencode.ai's free tier (/zen/v1) returns FreeUsageLimitError 429 for generic client UAs egressing from datacenter IPs, which made the #5997 CLI-identity synthesis ineffective for non-CLI clients. Client UAs already matching opencode-cli/… are preserved (the real CLI's versioned identity stays intact); all other client-supplied x-opencode-* headers keep client-wins. Regression guard: tests/unit/opencode-cli-headers-synthesis-5997.test.ts (7, incl. non-CLI UA replaced + CLI UA preserved). (#5997 follow-up)