diff --git a/src/commands/models.list.test.ts b/src/commands/models.list.test.ts index c3c5a63414..c8dd916ee3 100644 --- a/src/commands/models.list.test.ts +++ b/src/commands/models.list.test.ts @@ -382,55 +382,6 @@ describe("models list/status", () => { listProfilesForProvider.mockReturnValue([]); }); - it("models list falls back to auth heuristics when registry availability is unavailable", async () => { - loadConfig.mockReturnValue({ - agents: { - defaults: { - model: "google-antigravity/claude-opus-4-6-thinking", - models: { - "google-antigravity/claude-opus-4-6-thinking": {}, - }, - }, - }, - }); - listProfilesForProvider.mockImplementation((_: unknown, provider: string) => - provider === "google-antigravity" - ? ([{ id: "profile-1" }] as Array>) - : [], - ); - modelRegistryState.getAvailableError = Object.assign( - new Error("availability unsupported: getAvailable failed"), - { code: "MODEL_AVAILABILITY_UNAVAILABLE" }, - ); - const runtime = makeRuntime(); - - modelRegistryState.models = [ - { - provider: "google-antigravity", - id: "claude-opus-4-5-thinking", - name: "Claude Opus 4.5 Thinking", - api: "google-gemini-cli", - input: ["text", "image"], - baseUrl: "https://daily-cloudcode-pa.sandbox.googleapis.com", - contextWindow: 200000, - maxTokens: 64000, - reasoning: true, - cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 }, - }, - ]; - modelRegistryState.available = []; - await modelsListCommand({ json: true }, runtime); - - expect(runtime.error).toHaveBeenCalledTimes(1); - expect(runtime.error.mock.calls[0]?.[0]).toContain("falling back to auth heuristics"); - expect(runtime.error.mock.calls[0]?.[0]).toContain("getAvailable failed"); - expect(runtime.log).toHaveBeenCalledTimes(1); - const payload = JSON.parse(String(runtime.log.mock.calls[0]?.[0])); - expect(payload.models[0]?.key).toBe("google-antigravity/claude-opus-4-6-thinking"); - expect(payload.models[0]?.missing).toBe(false); - expect(payload.models[0]?.available).toBe(true); - }); - it("models list falls back to auth heuristics when getAvailable returns invalid shape", async () => { loadConfig.mockReturnValue({ agents: {