feat(opencode): add copilot specific provider to properly handle copilot reasoning tokens (#8900)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
Steffen Deusch
2026-01-31 02:53:22 +01:00
committed by GitHub
parent 2f4374c829
commit d9f18e4006
33 changed files with 2381 additions and 17 deletions

View File

@@ -1101,21 +1101,21 @@ describe("ProviderTransform.message - providerOptions key remapping", () => {
expect(result[0].providerOptions?.openai).toBeUndefined()
})
test("openai with github-copilot npm remaps providerID to 'openai'", () => {
test("copilot remaps providerID to 'copilot' key", () => {
const model = createModel("github-copilot", "@ai-sdk/github-copilot")
const msgs = [
{
role: "user",
content: "Hello",
providerOptions: {
"github-copilot": { someOption: "value" },
"copilot": { someOption: "value" },
},
},
] as any[]
const result = ProviderTransform.message(msgs, model, {})
expect(result[0].providerOptions?.openai).toEqual({ someOption: "value" })
expect(result[0].providerOptions?.copilot).toEqual({ someOption: "value" })
expect(result[0].providerOptions?.["github-copilot"]).toBeUndefined()
})