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
provider headers from config not applied to fetch requests #11789
When configuring custom headers (including User-Agent) for a provider or model in opencode.jsonc, the headers are not actually sent with the API requests.
However, in the custom fetch function, opts.headers comes from the init parameter passed by the AI SDK, not from options["headers"]. This means the configured headers are never actually included in the request.
Solution
Update the custom fetch function to merge options["headers"] into opts.headers:
Activity
github-actions commentedon Feb 2, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
fix(provider): apply config headers to fetch requests
lailoo commentedon Feb 3, 2026
I addressed this issue in PR #11978
If you have some time, I'd really appreciate it if you could take a look.
Solution: Merged
options["headers"]intoopts.headersin the custom fetch function, exactly as you suggested in the issue description.