惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
I
InfoQ
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
GbyAI
GbyAI
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
美团技术团队
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
M
MIT News - Artificial intelligence
D
Docker
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 叶小钗

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(configure): use manifest model catalogs in picker · o...
obviyus · 2026-04-29 · via Recent Commits to openclaw:main

@@ -1,4 +1,4 @@

1-

import { describe, expect, it, vi } from "vitest";

1+

import { beforeEach, describe, expect, it, vi } from "vitest";

22

import type { RuntimeEnv } from "../runtime.js";

33

import type { WizardPrompter } from "../wizard/prompts.js";

44

@@ -10,6 +10,7 @@ const mocks = vi.hoisted(() => ({

1010

promptCustomApiConfig: vi.fn(),

1111

resolvePluginProviders: vi.fn(() => []),

1212

resolveProviderPluginChoice: vi.fn<() => unknown>(() => null),

13+

loadStaticManifestCatalogRowsForList: vi.fn(() => []),

1314

resolvePreferredProviderForAuthChoice: vi.fn<() => Promise<string | undefined>>(

1415

async () => undefined,

1516

),

@@ -52,8 +53,16 @@ vi.mock("../plugins/provider-wizard.js", () => ({

5253

resolveProviderPluginChoice: mocks.resolveProviderPluginChoice,

5354

}));

545556+

vi.mock("./models/list.manifest-catalog.js", () => ({

57+

loadStaticManifestCatalogRowsForList: mocks.loadStaticManifestCatalogRowsForList,

58+

}));

59+5560

import { promptAuthConfig } from "./configure.gateway-auth.js";

566162+

beforeEach(() => {

63+

mocks.loadStaticManifestCatalogRowsForList.mockReturnValue([]);

64+

});

65+5766

function makeRuntime(): RuntimeEnv {

5867

return {

5968

log: vi.fn(),

@@ -311,6 +320,88 @@ describe("promptAuthConfig", () => {

311320

);

312321

});

313322323+

it("loads plugin catalog when the selected provider allowlist requires it", async () => {

324+

vi.clearAllMocks();

325+

mocks.promptAuthChoiceGrouped.mockResolvedValue("github-copilot");

326+

mocks.resolvePreferredProviderForAuthChoice.mockResolvedValue("github-copilot");

327+

mocks.applyAuthChoice.mockResolvedValue({

328+

config: {

329+

agents: {

330+

defaults: {

331+

model: { primary: "anthropic/claude-opus-4-7" },

332+

models: {

333+

"github-copilot/claude-opus-4.7": {},

334+

},

335+

},

336+

},

337+

},

338+

});

339+

mocks.promptModelAllowlist.mockResolvedValue({ models: undefined });

340+

mocks.resolveProviderPluginChoice.mockReturnValue({

341+

provider: {

342+

id: "github-copilot",

343+

label: "GitHub Copilot",

344+

auth: [],

345+

wizard: {

346+

setup: {

347+

modelAllowlist: {

348+

loadCatalog: true,

349+

},

350+

},

351+

},

352+

},

353+

method: { id: "device", label: "GitHub device login", kind: "device_code" },

354+

});

355+356+

await promptAuthConfig({}, makeRuntime(), noopPrompter);

357+358+

expect(mocks.promptModelAllowlist).toHaveBeenCalledWith(

359+

expect.objectContaining({

360+

preferredProvider: "github-copilot",

361+

loadCatalog: true,

362+

}),

363+

);

364+

});

365+366+

it("loads catalog when the selected provider has manifest catalog rows", async () => {

367+

vi.clearAllMocks();

368+

mocks.promptAuthChoiceGrouped.mockResolvedValue("github-copilot");

369+

mocks.resolvePreferredProviderForAuthChoice.mockResolvedValue("github-copilot");

370+

mocks.applyAuthChoice.mockResolvedValue({

371+

config: {

372+

agents: {

373+

defaults: {

374+

models: {

375+

"github-copilot/claude-opus-4.7": {},

376+

},

377+

},

378+

},

379+

},

380+

});

381+

mocks.promptModelAllowlist.mockResolvedValue({ models: undefined });

382+

mocks.resolvePluginProviders.mockReturnValue([]);

383+

mocks.resolveProviderPluginChoice.mockReturnValue(null);

384+

mocks.loadStaticManifestCatalogRowsForList.mockReturnValue([

385+

{

386+

provider: "github-copilot",

387+

id: "claude-opus-4.7",

388+

name: "Claude Opus 4.7",

389+

ref: "github-copilot/claude-opus-4.7",

390+

mergeKey: "github-copilot:claude-opus-4.7",

391+

source: "manifest",

392+

input: ["text"],

393+

reasoning: false,

394+

status: "available",

395+

},

396+

]);

397+398+

await promptAuthConfig({}, makeRuntime(), noopPrompter);

399+400+

const call = mocks.promptModelAllowlist.mock.calls[0]?.[0];

401+

expect(call?.preferredProvider).toBe("github-copilot");

402+

expect(call?.loadCatalog).toBe(true);

403+

});

404+314405

it("returns to auth selection when plugin install onboarding asks for a retry", async () => {

315406

vi.clearAllMocks();

316407

mocks.promptAuthChoiceGrouped