

















@@ -549,6 +549,75 @@ describe("modelsListCommand forward-compat", () => {
549549]);
550550});
551551552+it("includes configured provider and auth-backed catalog rows in configured-mode lists", async () => {
553+const config = {
554+agents: { defaults: { model: { primary: "xiaomi/mimo-v2.5-pro" } } },
555+models: {
556+providers: {
557+xiaomi: {
558+api: "openai-completions",
559+apiKey: "tp-fixture",
560+baseUrl: "https://api.xiaomi.example/v1",
561+models: [
562+{ id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro", input: ["text"] },
563+{ id: "mimo-v2.5", name: "MiMo V2.5", input: ["text", "image"] },
564+],
565+},
566+},
567+},
568+};
569+mocks.loadModelsConfigWithSource.mockResolvedValueOnce({
570+sourceConfig: config,
571+resolvedConfig: config,
572+diagnostics: [],
573+});
574+mocks.ensureAuthProfileStore.mockReturnValueOnce({
575+version: 1,
576+profiles: {
577+"google:default": {
578+type: "api_key",
579+provider: "google",
580+key: "google-fixture",
581+},
582+},
583+order: {},
584+});
585+mocks.resolveConfiguredEntries.mockReturnValueOnce({
586+entries: [
587+{
588+key: "xiaomi/mimo-v2.5-pro",
589+ref: { provider: "xiaomi", model: "mimo-v2.5-pro" },
590+tags: new Set(["default"]),
591+aliases: [],
592+},
593+],
594+});
595+mocks.loadModelCatalog.mockResolvedValueOnce([
596+{
597+provider: "google",
598+id: "gemini-3.1-flash-lite-preview",
599+name: "Gemini 3.1 Flash Lite Preview",
600+input: ["text"],
601+contextWindow: 1_000_000,
602+},
603+]);
604+const runtime = createRuntime();
605+606+await modelsListCommand({ json: true }, runtime as never);
607+608+expect(mocks.loadModelRegistry).not.toHaveBeenCalled();
609+const rows = lastPrintedRows<{ key: string; name: string; available: boolean }>();
610+expect(rows).toEqual([
611+expect.objectContaining({ key: "xiaomi/mimo-v2.5-pro", name: "MiMo V2.5 Pro" }),
612+expect.objectContaining({ key: "xiaomi/mimo-v2.5", name: "MiMo V2.5" }),
613+expect.objectContaining({
614+key: "google/gemini-3.1-flash-lite-preview",
615+name: "Gemini 3.1 Flash Lite Preview",
616+available: true,
617+}),
618+]);
619+});
620+552621it("does not mark configured codex model as missing when forward-compat can build a fallback", async () => {
553622const runtime = createRuntime();
554623此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。