Compare commits

...
Author SHA1 Message Date
Filip 18522025a8 fix: drop GitHub token env for Copilot 2026-08-25 14:02:28 +00:00
3 changed files with 15 additions and 2 deletions

No files matched your search

+5 -1
View File
@@ -379,7 +379,11 @@ export type Model = z.infer<typeof Model>;
export const Provider = z
.object({
id: z.string(),
env: z.array(z.string()).min(1, "Provider env cannot be empty"),
env: z
.array(z.string())
.min(1, "Provider env cannot be empty")
.optional()
.transform((env) => env ?? []),
npm: z.string().min(1, "Provider npm module cannot be empty"),
api: z.string().optional(),
name: z.string().min(1, "Provider name cannot be empty"),
+10
View File
@@ -124,6 +124,16 @@ describe("provider schema", () => {
expect(Provider.safeParse(mergeGatewayProvider).success).toBe(true);
});
test("defaults omitted provider env to an empty list", () => {
const { env: _env, ...providerWithoutEnv } = mergeGatewayProvider;
const result = Provider.safeParse(providerWithoutEnv);
expect(result.success).toBe(true);
if (!result.success) return;
expect(result.data.env).toEqual([]);
});
test("requires the compatibility API for the Merge Gateway package", () => {
const { api: _api, ...providerWithoutApi } = mergeGatewayProvider;
-1
View File
@@ -5,7 +5,6 @@ name = "GitHub Copilot"
# document this private request schema or static mappings.
# https://api.githubcopilot.com/models
# https://docs.github.com/en/copilot/reference/ai-models/model-comparison
env = ["GITHUB_TOKEN"]
npm = "@ai-sdk/openai-compatible"
doc = "https://docs.github.com/en/copilot"
api= "https://api.githubcopilot.com"