-
Notifications
You must be signed in to change notification settings - Fork 13k
fix(github-copilot): auto-route GPT-5+ models to Responses API #5877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rekram1-node
merged 9 commits into
anomalyco:dev
from
EntityProcess:feature/copilot-responses-api
Jan 19, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
320ecd7
feat: opt-in Copilot Responses API for GPT-5+
christso 6c94c9b
fix: don't route gpt-5-mini to Copilot Responses API
christso 4f9676d
refactor: simplify Copilot Responses API routing
christso bcfc34e
refactor: remove opt-in for Copilot Responses API routing
christso 7539644
Merge branch 'dev' into feature/copilot-responses-api
christso 87a547c
Merge branch 'dev' into feature/copilot-responses-api
christso 894861c
fix: set store=false for github-copilot Response API
christso 2f58f80
refactor: use api.npm instead of providerID for github-copilot store …
christso 6dcb0d9
Merge branch 'dev' into feature/copilot-responses-api
christso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do u need this? hmm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for copilot? is that what vscode does too? or other copilot clients
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refined the condition to use
api.npm === "@ai-sdk/github-copilot"instead ofproviderID.startsWith("github-copilot")for consistency with the existingapi.npm === "@ai-sdk/openai"check.TL;DR: Removing the conditional would technically work (SDKs currently strip unknown options), but it introduces unnecessary overhead, future risk, and is semantically incorrect. Refactoring to a cleaner architecture is out of scope for this fix.
Details
Why not just remove the conditional?
While SDKs currently strip unknown
providerOptionssilently (Zod schemas without.strict()), removing the conditional is problematic:.strict()validation or their API starts rejecting unknown fields, it would breakWhy not refactor to a VS Code-style "caller decides" approach?
VS Code uses a pass-through model where extensions decide what options to send. To achieve this in opencode would require significant architectural changes:
storelogic out ofProviderTransform.options()(the centralized option builder)session/llm.tsor highercompat.supportsStorewith auto-detectionAll of these are out of scope for what should be a one-line fix.
Research findings:
VS Code uses a pass-through approach where
providerOptionsare typed as{ [name: string]: any }with no filtering—but extensions decide what to send, they don't set options unconditionally.AI SDK behavior: Both
@ai-sdk/anthropicand@ai-sdk/googleuse Zod schemas to validateproviderOptions. Since neither uses.strict(), unknown keys are silently stripped—but this is an implementation detail, not a contract.pi-mono uses a cleaner
compat.supportsStorecapability flag with auto-detection—a better architecture but significant refactoring.Why keep the conditional:
transform.tsfor other provider-specific options (OpenRouterusage.include, GooglethinkingConfig, ZhipuAIthinking, etc.)