mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-10 02:39:56 +00:00
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:
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user