mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(coding-agent): use current Copilot model in registry test
This commit is contained in:
parent
ef41a24b39
commit
744a94d7d4
1 changed files with 6 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ import type {
|
|||
Model,
|
||||
OpenAICompletionsCompat,
|
||||
} from "@earendil-works/pi-ai/compat";
|
||||
import { getApiProvider, getSupportedThinkingLevels } from "@earendil-works/pi-ai/compat";
|
||||
import { getApiProvider, getModels, getSupportedThinkingLevels } from "@earendil-works/pi-ai/compat";
|
||||
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import { AuthStorage } from "../src/core/auth-storage.ts";
|
||||
import type { ModelsJsonProvider } from "../src/core/model-config.ts";
|
||||
|
|
@ -1879,12 +1879,15 @@ describe("ModelRegistry", () => {
|
|||
});
|
||||
|
||||
test("getAvailable filters GitHub Copilot OAuth models to account picker availability", async () => {
|
||||
const copilotModel = getModels("github-copilot")[0];
|
||||
if (!copilotModel) throw new Error("Expected at least one GitHub Copilot model");
|
||||
|
||||
await authStorage.modify("github-copilot", async () => ({
|
||||
type: "oauth",
|
||||
refresh: "github-access-token",
|
||||
access: "tid=test;exp=9999999999;proxy-ep=proxy.individual.githubcopilot.com;",
|
||||
expires: Date.now() + 60_000,
|
||||
availableModelIds: ["gpt-4.1"],
|
||||
availableModelIds: [copilotModel.id],
|
||||
}));
|
||||
|
||||
const registry = await createModelRegistry(authStorage, modelsJsonPath);
|
||||
|
|
@ -1894,7 +1897,7 @@ describe("ModelRegistry", () => {
|
|||
.getAvailable()
|
||||
.filter((m) => m.provider === "github-copilot")
|
||||
.map((m) => m.id),
|
||||
).toEqual(["gpt-4.1"]);
|
||||
).toEqual([copilotModel.id]);
|
||||
});
|
||||
|
||||
test("getApiKeyAndHeaders resolves authHeader on every request", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue