You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Custom provider headers (User-Agent) from opencode.json not applied to fetch requests #22608
When configuring custom headers for a provider in opencode.json, the User-Agent header (and potentially other custom headers) is not actually sent with the API requests.
This is particularly important for providers like Kimi (https://api.kimi.com/coding/v1), where sending a custom User-Agent unlocks higher rate limits and additional coding plan quotas.
The User-Agent: KimiCLI/1.30.0 header should be included in the HTTP requests sent to the provider API.
Actual Behavior
The custom User-Agent header is not applied to the outgoing fetch requests. This causes the provider to treat the request as a generic client, missing out on official client benefits (e.g., higher rate limits, extra coding plan quota for Kimi).
Real-world business impact: For the Kimi provider (api.kimi.com/coding/v1), the User-Agent header is not cosmetic — it directly determines:
Request routing and speed: Requests without the official User-Agent (KimiCLI/1.30.0) are routed to a lower-priority tier.
Coding plan quota: Kimi allocates additional coding-plan credits only to requests that identify as the official CLI client. Without this header, users burn through their generic quota much faster and hit rate limits sooner.
Could a maintainer please confirm whether the custom fetch wrapper in provider.ts is stripping/overwriting the User-Agent header? Happy to provide packet captures or verbose logs if needed.
Activity
github-actions commentedon Apr 15, 2026
This issue might be a duplicate of existing issues. Please check:
User-Agent) not reaching the actual HTTP request layer.woaye168 commentedon Apr 15, 2026
Thanks for the triage, but I believe this issue is distinct from #15306 in a few important ways:
Specific symptom: Are custom provider headers from config expected to work in v1.2.x? #15306 is a broad question about whether any custom provider headers work. This issue is specifically about the
User-Agentheader being silently dropped, which is a concrete, reproducible bug.Real-world business impact: For the Kimi provider (
api.kimi.com/coding/v1), theUser-Agentheader is not cosmetic — it directly determines:User-Agent(KimiCLI/1.30.0) are routed to a lower-priority tier.Regression context: provider headers from config not applied to fetch requests #11789 reported the exact same bug and was closed as "fixed" by PR fix(provider): apply config headers to fetch requests #11978. The fact that
User-Agentis still not being forwarded today suggests the previous fix was either incomplete or regressed. This issue highlights a specific header that the prior fix missed.Could a maintainer please confirm whether the custom
fetchwrapper inprovider.tsis stripping/overwriting theUser-Agentheader? Happy to provide packet captures or verbose logs if needed.github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.