-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Changes from 7 commits
320ecd7
6c94c9b
4f9676d
bcfc34e
7539644
87a547c
894861c
2f58f80
6dcb0d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -484,7 +484,11 @@ export namespace ProviderTransform { | |
| const result: Record<string, any> = {} | ||
|
|
||
| // openai and providers using openai package should set store to false by default. | ||
| if (input.model.providerID === "openai" || input.model.api.npm === "@ai-sdk/openai") { | ||
| if ( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do u need this? hmm
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for copilot? is that what vscode does too? or other copilot clients
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refined the condition to use 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. DetailsWhy not just remove the conditional? While SDKs currently strip unknown
Why 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:
All of these are out of scope for what should be a one-line fix. Research findings:
Why keep the conditional:
|
||
| input.model.providerID === "openai" || | ||
| input.model.api.npm === "@ai-sdk/openai" || | ||
| input.model.providerID.startsWith("github-copilot") | ||
| ) { | ||
| result["store"] = false | ||
| } | ||
|
|
||
|
|
||
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.
if they support it for all gpt-5 variants just change condition to modelID.includes("gpt-5")?
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.
gpt-5-mini is not supported and I was probably being overly conservative. Should I remove opt-in and just get all gpt-5 variants (excluding gpt-5-mini) to use responses API?
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.
I've simplified the logic now. No opt-in. Includes all gpt-5 variants except gpt-5-mini (refer to #5866 for reasoning).
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.
All gpt models support it now, so just do the "gpt-5" check and we can merge
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.
E2E testing confirmed gpt-5-mini does NOT support the Responses API. GitHub Copilot's backend returns:

model gpt-5-mini is not supported via Responses API. The exclusion must stay.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.
That's strange cause it works for me and their api says it supports it
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.
OpenAI supports gpt-5-mini on Responses API, but GitHub Copilot does NOT. Are you testing against OpenAI directly (api.openai.com) or GitHub Copilot (api.githubcopilot.com)?
You can copy this curl command and run it with your own token. The API explicitly returns error code unsupported_api_for_model.
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.
I'm testing directly w/ copilot and it does work and when I hit copilot endpoint to get their models list that works too, also discussed w/ multiple others and it worked for them as well
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.
but ig there is some oddity to it
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.
I'm on copilot enterprise, maybe it behaves differently.