chore: fork — remove vendor CI, repoint release checks to Neuron Gitea
This commit is contained in:
@@ -1156,8 +1156,7 @@ describe("ProviderTransform.schema - gemini type arrays", () => {
|
||||
// arrays (e.g. `["number","string"]`, common in MCP tool schemas) become an
|
||||
// `anyOf` of single-type schemas, with `null` lifted into `nullable`. Plain
|
||||
// @ai-sdk/google rewrites these, but OpenAI-compatible transports such as
|
||||
// GitHub Copilot (proxying to Gemini) forward them verbatim and the backend
|
||||
// rejects the array form.
|
||||
|
||||
const geminiModel = {
|
||||
providerID: "google",
|
||||
api: {
|
||||
@@ -1211,31 +1210,6 @@ describe("ProviderTransform.schema - gemini type arrays", () => {
|
||||
expect(result.properties.nothing.anyOf).toBeUndefined()
|
||||
})
|
||||
|
||||
test("rewrites type arrays for gemini served through github-copilot", () => {
|
||||
const copilotGeminiModel = {
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gemini-3.5-flash",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
} as any
|
||||
|
||||
const schema = {
|
||||
type: "object",
|
||||
properties: {
|
||||
hook_id: { type: "number", description: "ID of the webhook" },
|
||||
status: { type: ["number", "string"], description: "Filter by response status code" },
|
||||
},
|
||||
required: ["hook_id"],
|
||||
additionalProperties: false,
|
||||
} as any
|
||||
|
||||
const result = ProviderTransform.schema(copilotGeminiModel, schema) as any
|
||||
|
||||
expect(result.properties.status.anyOf).toEqual([{ type: "number" }, { type: "string" }])
|
||||
expect(result.properties.status.type).toBeUndefined()
|
||||
expect(result.properties.hook_id.type).toBe("number")
|
||||
})
|
||||
})
|
||||
|
||||
describe("ProviderTransform.schema - gemini combiner nodes", () => {
|
||||
@@ -2604,81 +2578,7 @@ describe("ProviderTransform.message - strip openai metadata when store=false", (
|
||||
expect(result[0].content[0].providerOptions?.openai?.reasoningEncryptedContent).toBe("encrypted")
|
||||
})
|
||||
|
||||
test("strips GitHub Copilot itemId from the copilot namespace, preserving other copilot options", () => {
|
||||
const copilotModel = {
|
||||
...openaiModel,
|
||||
id: "github-copilot/gpt-5.5",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.5",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
}
|
||||
const msgs = [
|
||||
{
|
||||
role: "assistant",
|
||||
content: [
|
||||
{
|
||||
type: "reasoning",
|
||||
text: "thinking...",
|
||||
providerOptions: {
|
||||
copilot: { itemId: "rs_123", reasoningEncryptedContent: "encrypted" },
|
||||
},
|
||||
},
|
||||
{
|
||||
// The stale itemId on tool-call parts is what Copilot echoes back as the
|
||||
// `function_call` item `id`, which is what the upstream connection rejects.
|
||||
type: "tool-call",
|
||||
toolCallId: "call_1",
|
||||
toolName: "bash",
|
||||
input: { command: "ls" },
|
||||
providerOptions: {
|
||||
copilot: { itemId: "fc_456", reasoningEffort: "medium" },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
] as any[]
|
||||
|
||||
const result = ProviderTransform.message(msgs, copilotModel, { store: false }) as any[]
|
||||
|
||||
expect(result[0].content[0].providerOptions?.copilot?.itemId).toBeUndefined()
|
||||
expect(result[0].content[0].providerOptions?.copilot?.reasoningEncryptedContent).toBe("encrypted")
|
||||
expect(result[0].content[1].providerOptions?.copilot?.itemId).toBeUndefined()
|
||||
expect(result[0].content[1].providerOptions?.copilot?.reasoningEffort).toBe("medium")
|
||||
})
|
||||
|
||||
test("leaves a stray openai namespace on a Copilot model untouched, since Copilot's Responses model only reads the copilot namespace", () => {
|
||||
const copilotModel = {
|
||||
...openaiModel,
|
||||
id: "github-copilot/gpt-5.5",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.5",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
}
|
||||
const msgs = [
|
||||
{
|
||||
role: "assistant",
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: "Hello",
|
||||
providerOptions: {
|
||||
openai: { itemId: "msg_456" },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
] as any[]
|
||||
|
||||
const result = ProviderTransform.message(msgs, copilotModel, { store: false }) as any[]
|
||||
|
||||
expect(result[0].content[0].providerOptions?.openai?.itemId).toBe("msg_456")
|
||||
})
|
||||
|
||||
test("preserves metadata for openai package when store is true", () => {
|
||||
const msgs = [
|
||||
@@ -2920,23 +2820,6 @@ describe("ProviderTransform.message - providerOptions key remapping", () => {
|
||||
expect(part.providerOptions?.["azure-cognitive-services"]).toBeUndefined()
|
||||
})
|
||||
|
||||
test("copilot remaps providerID to 'copilot' key", () => {
|
||||
const model = createModel("github-copilot", "@ai-sdk/github-copilot")
|
||||
const msgs = [
|
||||
{
|
||||
role: "user",
|
||||
content: "Hello",
|
||||
providerOptions: {
|
||||
copilot: { someOption: "value" },
|
||||
},
|
||||
},
|
||||
] as any[]
|
||||
|
||||
const result = ProviderTransform.message(msgs, model, {})
|
||||
|
||||
expect(result[0].providerOptions?.copilot).toEqual({ someOption: "value" })
|
||||
expect(result[0].providerOptions?.["github-copilot"]).toBeUndefined()
|
||||
})
|
||||
|
||||
test("bedrock remaps providerID to 'bedrock' key", () => {
|
||||
const model = createModel("my-bedrock", "@ai-sdk/amazon-bedrock")
|
||||
@@ -3119,11 +3002,6 @@ describe("ProviderTransform.message - cache control on gateway", () => {
|
||||
type: "ephemeral",
|
||||
},
|
||||
},
|
||||
copilot: {
|
||||
copilot_cache_control: {
|
||||
type: "ephemeral",
|
||||
},
|
||||
},
|
||||
alibaba: {
|
||||
cacheControl: {
|
||||
type: "ephemeral",
|
||||
@@ -3190,11 +3068,6 @@ describe("ProviderTransform.message - cache control on gateway", () => {
|
||||
type: "ephemeral",
|
||||
},
|
||||
},
|
||||
copilot: {
|
||||
copilot_cache_control: {
|
||||
type: "ephemeral",
|
||||
},
|
||||
},
|
||||
alibaba: {
|
||||
cacheControl: {
|
||||
type: "ephemeral",
|
||||
@@ -3366,14 +3239,6 @@ describe("ProviderTransform.reasoningVariants", () => {
|
||||
include: ["reasoning.encrypted_content"],
|
||||
},
|
||||
],
|
||||
[
|
||||
"@ai-sdk/github-copilot",
|
||||
{
|
||||
reasoningEffort: "high",
|
||||
reasoningSummary: "auto",
|
||||
include: ["reasoning.encrypted_content"],
|
||||
},
|
||||
],
|
||||
["@ai-sdk/openai-compatible", { reasoningEffort: "high" }],
|
||||
["@ai-sdk/xai", { reasoningEffort: "high" }],
|
||||
["@ai-sdk/mistral", { reasoningEffort: "high" }],
|
||||
@@ -3621,18 +3486,6 @@ describe("ProviderTransform.reasoningVariants", () => {
|
||||
expect(ProviderTransform.reasoningVariants(model([{ type: "toggle" }]), target("@ai-sdk/openai"))).toBeUndefined()
|
||||
})
|
||||
|
||||
test("uses model-family options for gateway and GitHub Copilot", () => {
|
||||
const effort = model([{ type: "effort", values: ["high"] }])
|
||||
expect(ProviderTransform.reasoningVariants(effort, target("@ai-sdk/gateway", "anthropic/claude-sonnet-4"))).toEqual(
|
||||
{
|
||||
high: { thinking: { type: "adaptive", display: "summarized" }, effort: "high" },
|
||||
},
|
||||
)
|
||||
expect(ProviderTransform.reasoningVariants(effort, target("@ai-sdk/gateway", "google/gemini-3-pro"))).toEqual({
|
||||
high: { thinkingConfig: { includeThoughts: true, thinkingLevel: "high" } },
|
||||
})
|
||||
expect(ProviderTransform.reasoningVariants(effort, target("@ai-sdk/github-copilot", "gemini-3-pro"))).toEqual({})
|
||||
})
|
||||
|
||||
test.each(["@ai-sdk/cohere", "@ai-sdk/perplexity", "@ai-sdk/vercel", "@ai-sdk/alibaba", "gitlab-ai-provider"])(
|
||||
"does not invent effort controls for %s",
|
||||
@@ -4313,130 +4166,6 @@ describe("ProviderTransform.variants", () => {
|
||||
}
|
||||
})
|
||||
|
||||
describe("@ai-sdk/github-copilot", () => {
|
||||
test("standard models return low, medium, high", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-4.5",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-4.5",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high"])
|
||||
expect(result.low).toEqual({
|
||||
reasoningEffort: "low",
|
||||
reasoningSummary: "auto",
|
||||
include: ["reasoning.encrypted_content"],
|
||||
})
|
||||
})
|
||||
|
||||
test("gpt-5.1-codex-max includes xhigh", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-5.1-codex-max",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.1-codex-max",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
|
||||
})
|
||||
|
||||
test("gpt-5.1-codex-mini does not include xhigh", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-5.1-codex-mini",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.1-codex-mini",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high"])
|
||||
})
|
||||
|
||||
test("gpt-5.1-codex does not include xhigh", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-5.1-codex",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.1-codex",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high"])
|
||||
})
|
||||
|
||||
test("gpt-5.2 includes xhigh", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-5.2",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.2",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
|
||||
expect(result.xhigh).toEqual({
|
||||
reasoningEffort: "xhigh",
|
||||
reasoningSummary: "auto",
|
||||
include: ["reasoning.encrypted_content"],
|
||||
})
|
||||
})
|
||||
|
||||
test("gpt-5.2-codex includes xhigh", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-5.2-codex",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.2-codex",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
|
||||
})
|
||||
|
||||
test("gpt-5.3-codex includes xhigh", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-5.3-codex",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.3-codex",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
|
||||
})
|
||||
|
||||
test("gpt-5.4 includes xhigh", () => {
|
||||
const model = createMockModel({
|
||||
id: "gpt-5.4",
|
||||
release_date: "2026-03-05",
|
||||
providerID: "github-copilot",
|
||||
api: {
|
||||
id: "gpt-5.4",
|
||||
url: "https://api.githubcopilot.com",
|
||||
npm: "@ai-sdk/github-copilot",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
|
||||
})
|
||||
})
|
||||
|
||||
describe("@ai-sdk/cerebras", () => {
|
||||
test("returns WIDELY_SUPPORTED_EFFORTS with reasoningEffort", () => {
|
||||
@@ -4862,27 +4591,6 @@ 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({
|
||||
|
||||
Reference in New Issue
Block a user