fix(copilot): ensure available variants sync from api (#24734)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Aiden Cline
2026-04-28 14:58:51 -05:00
committed by GitHub
parent 276d162044
commit 0acac216ae
5 changed files with 176 additions and 11 deletions

View File

@@ -2917,6 +2917,28 @@ describe("ProviderTransform.variants", () => {
})
})
test("github copilot opus 4.7 returns only medium reasoning effort", () => {
const model = createMockModel({
id: "claude-opus-4.7",
providerID: "github-copilot",
api: {
id: "claude-opus-4.7",
url: "https://api.githubcopilot.com/v1",
npm: "@ai-sdk/anthropic",
},
})
const result = ProviderTransform.variants(model)
expect(result).toEqual({
medium: {
thinking: {
type: "adaptive",
display: "summarized",
},
effort: "medium",
},
})
})
test("returns high and max with thinking config", () => {
const model = createMockModel({
id: "anthropic/claude-4",