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
prepareOptions() drops model.request.headers — custom headers from provider config never reach SDK factory #36619
When configuring a provider with custom headers (e.g. User-Agent or x-api-key for third-party compatible APIs), those headers are correctly extracted by the lowerer into model.request.headers, but prepareOptions() in aisdk.ts never merges them into the options object passed to the SDK factory (createAnthropic() etc.). The headers are silently dropped.
To reproduce
Configure any V1 provider with headers in options, for example a third-party API that requires User-Agent: opencode/1.0:
Observe that the header never appears in the actual HTTP request — the lowerer places it in request.headers, but prepareOptions() ignores request.headers.
Expected behavior
model.request.headers should be merged into the SDK options, matching how settings and body are already handled.
Additional context
The data flow:
Config provider options → lowerer correctly extracts headers into provider.request.headers
projectModel() in catalog.ts correctly merges provider-level and model-level headers into model.request.headers
prepareOptions() ignores model.request.headers — headers are lost
Fix is a 3-line addition in packages/core/src/aisdk.ts to merge model.request.headers into the options object.
Both describe headers configured under provider.<name>.options.headers not making it into outgoing HTTP requests. If those fixes didn't fully address the model.request.headers path in prepareOptions(), this may be a regression or a gap left by those fixes.
Activity
github-actions commentedon Jul 13, 2026
This issue might be a duplicate of existing issues. Please check:
Both describe headers configured under
provider.<name>.options.headersnot making it into outgoing HTTP requests. If those fixes didn't fully address themodel.request.headerspath inprepareOptions(), this may be a regression or a gap left by those fixes.github-actions commentedon Sep 12, 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.