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
github-copilot plugin: provider.options.headers from config are not sent on the models() request #23816
The github-copilot provider plugin ignores user-configured headers (provider.github-copilot.options.headers in opencode.json) when it fetches the list of available models. The same headers are honoured for chat requests via the plugin's fetch wrapper, so the behaviour is inconsistent.
Where
packages/opencode/src/plugin/github-copilot/copilot.ts, the provider.models() hook constructs its header map from scratch and does not read provider.options.headers:
By contrast, the auth.loader().fetch path does spread init.headers into the outgoing request, so config headers reach chat calls.
Why this matters
Users who configure extra headers in opencode.json reasonably expect those headers to apply to all requests the provider makes, including the model discovery call. Today they only apply to chat. This makes the model list returned by opencode models github-copilot (and the model picker) inconsistent with the model set actually reachable on chat requests, depending on what the user sets.
Capture the outgoing request to https://api.githubcopilot.com/models (e.g. via a proxy). The X-Test-Header is not present.
Start a chat with any github-copilot model. The same X-Test-Header is present on the completion request.
Expected
User-configured headers on the github-copilot provider should be sent on every request the plugin makes, including the models discovery call.
Proposed fix
Spread provider.options.headers into the headers object passed to CopilotModels.get(...) in the models() hook, while still letting the plugin set Authorization and User-Agent (so they cannot be accidentally unset).
Activity