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

推荐订阅源

T
Tailwind CSS Blog
S
Secure Thoughts
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tor Project blog
T
Tenable Blog
Know Your Adversary
Know Your Adversary
Webroot Blog
Webroot Blog
V
Vulnerabilities – Threatpost
WordPress大学
WordPress大学
S
Security @ Cisco Blogs
J
Java Code Geeks
S
SegmentFault 最新的问题
A
Arctic Wolf
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
Forbes - Security
Forbes - Security
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
S
Securelist
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
aimingoo的专栏
aimingoo的专栏
腾讯CDC
U
Unit 42
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
Latest news
Latest news
I
InfoQ
V2EX - 技术
V2EX - 技术
The Cloudflare Blog
V
V2EX
The Register - Security
The Register - Security
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
小众软件
小众软件
N
Netflix TechBlog - Medium
量子位
M
MIT News - Artificial intelligence

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
Fix infer SecretRef resolution for provider-backed commands (#82798) · openclaw/openclaw@2416de1
joshavant · 2026-05-17 · via Recent Commits to openclaw:main

@@ -20,6 +20,8 @@ const mocks = vi.hoisted(() => ({

2020

writeStdout: vi.fn(),

2121

},

2222

loadConfig: vi.fn(() => ({})),

23+

getRuntimeConfigSourceSnapshot: vi.fn(() => null),

24+

setRuntimeConfigSnapshot: vi.fn(),

2325

loadAuthProfileStoreForRuntime: vi.fn(() => ({ profiles: {}, order: {} })),

2426

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

2527

updateAuthProfileStoreWithLock: vi.fn(

@@ -133,6 +135,23 @@ const mocks = vi.hoisted(() => ({

133135

convertHeicToJpeg: vi.fn(async () => Buffer.from("jpeg-normalized")),

134136

isWebSearchProviderConfigured: vi.fn(() => false),

135137

isWebFetchProviderConfigured: vi.fn(() => false),

138+

resolveCommandConfigWithSecrets: vi.fn(async ({ config }: { config: unknown }) => ({

139+

resolvedConfig: config,

140+

effectiveConfig: config,

141+

diagnostics: [],

142+

})),

143+

getAgentRuntimeCommandSecretTargetIds: vi.fn(() => new Set(["agent-runtime-target"])),

144+

getMemoryEmbeddingCommandSecretTargetIds: vi.fn(() => new Set(["memory-target"])),

145+

getModelsCommandSecretTargetIds: vi.fn(() => new Set(["model-target"])),

146+

getTtsCommandSecretTargetIds: vi.fn(() => new Set(["tts-target"])),

147+

getWebFetchCommandSecretTargets: vi.fn(() => ({

148+

targetIds: new Set(["web-fetch-target"]),

149+

allowedPaths: new Set(["plugins.entries.firecrawl.config.webFetch.apiKey"]),

150+

})),

151+

getWebSearchCommandSecretTargets: vi.fn(() => ({

152+

targetIds: new Set(["web-search-target"]),

153+

allowedPaths: new Set(["plugins.entries.tavily.config.webSearch.apiKey"]),

154+

})),

136155

modelsStatusCommand: vi.fn(

137156

async (_opts: unknown, runtime: { log: (...args: unknown[]) => void }) => {

138157

runtime.log(JSON.stringify({ ok: true, providers: [{ id: "openai" }] }));

@@ -147,8 +166,12 @@ vi.mock("../runtime.js", () => ({

147166

}));

148167149168

vi.mock("../config/config.js", () => ({

169+

getRuntimeConfigSourceSnapshot:

170+

mocks.getRuntimeConfigSourceSnapshot as typeof import("../config/config.js").getRuntimeConfigSourceSnapshot,

150171

getRuntimeConfig: mocks.loadConfig as typeof import("../config/config.js").getRuntimeConfig,

151172

loadConfig: mocks.loadConfig as typeof import("../config/config.js").loadConfig,

173+

setRuntimeConfigSnapshot:

174+

mocks.setRuntimeConfigSnapshot as typeof import("../config/config.js").setRuntimeConfigSnapshot,

152175

}));

153176154177

vi.mock("../agents/agent-scope.js", () => ({

@@ -292,6 +315,26 @@ vi.mock("../web-fetch/runtime.js", () => ({

292315

resolveWebFetchDefinition: vi.fn(),

293316

}));

294317318+

vi.mock("./command-config-resolution.js", () => ({

319+

resolveCommandConfigWithSecrets:

320+

mocks.resolveCommandConfigWithSecrets as typeof import("./command-config-resolution.js").resolveCommandConfigWithSecrets,

321+

}));

322+323+

vi.mock("./command-secret-targets.js", () => ({

324+

getAgentRuntimeCommandSecretTargetIds:

325+

mocks.getAgentRuntimeCommandSecretTargetIds as typeof import("./command-secret-targets.js").getAgentRuntimeCommandSecretTargetIds,

326+

getMemoryEmbeddingCommandSecretTargetIds:

327+

mocks.getMemoryEmbeddingCommandSecretTargetIds as typeof import("./command-secret-targets.js").getMemoryEmbeddingCommandSecretTargetIds,

328+

getModelsCommandSecretTargetIds:

329+

mocks.getModelsCommandSecretTargetIds as typeof import("./command-secret-targets.js").getModelsCommandSecretTargetIds,

330+

getTtsCommandSecretTargetIds:

331+

mocks.getTtsCommandSecretTargetIds as typeof import("./command-secret-targets.js").getTtsCommandSecretTargetIds,

332+

getWebFetchCommandSecretTargets:

333+

mocks.getWebFetchCommandSecretTargets as typeof import("./command-secret-targets.js").getWebFetchCommandSecretTargets,

334+

getWebSearchCommandSecretTargets:

335+

mocks.getWebSearchCommandSecretTargets as typeof import("./command-secret-targets.js").getWebSearchCommandSecretTargets,

336+

}));

337+295338

describe("capability cli", () => {

296339

afterEach(() => {

297340

vi.unstubAllGlobals();

@@ -302,6 +345,8 @@ describe("capability cli", () => {

302345

mocks.runtime.log.mockClear();

303346

mocks.runtime.error.mockClear();

304347

mocks.runtime.writeJson.mockClear();

348+

mocks.getRuntimeConfigSourceSnapshot.mockReset().mockReturnValue(null);

349+

mocks.setRuntimeConfigSnapshot.mockClear();

305350

mocks.loadModelCatalog

306351

.mockReset()

307352

.mockResolvedValue([{ id: "gpt-5.4", provider: "openai", name: "GPT-5.4" }] as never);

@@ -352,6 +397,29 @@ describe("capability cli", () => {

352397

mocks.registerBuiltInMemoryEmbeddingProviders.mockClear();

353398

mocks.isWebSearchProviderConfigured.mockReset().mockReturnValue(false);

354399

mocks.isWebFetchProviderConfigured.mockReset().mockReturnValue(false);

400+

mocks.resolveCommandConfigWithSecrets

401+

.mockReset()

402+

.mockImplementation(async ({ config }: { config: unknown }) => ({

403+

resolvedConfig: config,

404+

effectiveConfig: config,

405+

diagnostics: [],

406+

}));

407+

mocks.getAgentRuntimeCommandSecretTargetIds

408+

.mockReset()

409+

.mockReturnValue(new Set(["agent-runtime-target"]));

410+

mocks.getMemoryEmbeddingCommandSecretTargetIds

411+

.mockReset()

412+

.mockReturnValue(new Set(["memory-target"]));

413+

mocks.getModelsCommandSecretTargetIds.mockReset().mockReturnValue(new Set(["model-target"]));

414+

mocks.getTtsCommandSecretTargetIds.mockReset().mockReturnValue(new Set(["tts-target"]));

415+

mocks.getWebFetchCommandSecretTargets.mockReset().mockReturnValue({

416+

targetIds: new Set(["web-fetch-target"]),

417+

allowedPaths: new Set(["plugins.entries.firecrawl.config.webFetch.apiKey"]),

418+

});

419+

mocks.getWebSearchCommandSecretTargets.mockReset().mockReturnValue({

420+

targetIds: new Set(["web-search-target"]),

421+

allowedPaths: new Set(["plugins.entries.tavily.config.webSearch.apiKey"]),

422+

});

355423

mocks.modelsStatusCommand.mockClear();

356424

mocks.callGateway.mockImplementation((async ({ method }: { method: string }) => {

357425

if (method === "tts.status") {

@@ -488,6 +556,13 @@ describe("capability cli", () => {

488556

return calls[0]?.[0];

489557

}

490558559+

function firstCommandConfigResolutionCall() {

560+

const calls = mocks.resolveCommandConfigWithSecrets.mock.calls as unknown as Array<

561+

[Record<string, unknown>]

562+

>;

563+

return calls[0]?.[0];

564+

}

565+491566

function expectModelRunDispatch(transport: "local" | "gateway", modelRef: string) {

492567

if (transport === "gateway") {

493568

const slash = modelRef.indexOf("/");

@@ -1814,6 +1889,35 @@ describe("capability cli", () => {

18141889

expect(firstJsonOutput()?.model).toBe("text-embedding-3-small");

18151890

});

181618911892+

it("resolves command SecretRefs before local model capability execution", async () => {

1893+

const rawConfig = { agents: { defaults: { model: "openai/gpt-5.4" } } };

1894+

const resolvedConfig = { agents: { defaults: { model: "openai/gpt-5.4" } }, resolved: true };

1895+

const targetIds = new Set(["models.providers.*.apiKey"]);

1896+

mocks.loadConfig.mockReturnValue(rawConfig);

1897+

mocks.getModelsCommandSecretTargetIds.mockReturnValue(targetIds);

1898+

mocks.resolveCommandConfigWithSecrets.mockResolvedValueOnce({

1899+

resolvedConfig,

1900+

effectiveConfig: resolvedConfig,

1901+

diagnostics: [],

1902+

} as never);

1903+1904+

await runRegisteredCli({

1905+

register: registerCapabilityCli as (program: Command) => void,

1906+

argv: ["capability", "model", "run", "--prompt", "hello", "--json"],

1907+

});

1908+1909+

expect(firstCommandConfigResolutionCall()).toEqual(

1910+

expect.objectContaining({

1911+

config: rawConfig,

1912+

commandName: "infer model run",

1913+

targetIds,

1914+

runtime: mocks.runtime,

1915+

}),

1916+

);

1917+

expect(firstPreparedModelParams()?.cfg).toBe(resolvedConfig);

1918+

expect(mocks.setRuntimeConfigSnapshot).toHaveBeenCalledWith(resolvedConfig);

1919+

});

1920+18171921

it("derives the embedding provider from a provider/model override", async () => {

18181922

await runRegisteredCli({

18191923

register: registerCapabilityCli as (program: Command) => void,

@@ -2098,6 +2202,159 @@ describe("capability cli", () => {

20982202

});

20992203

});

210022042205+

it("resolves command SecretRefs before local web search execution", async () => {

2206+

const rawConfig = {

2207+

tools: { web: { search: { provider: "brave" } } },

2208+

plugins: {

2209+

entries: {

2210+

tavily: {

2211+

config: {

2212+

webSearch: {

2213+

apiKey: { source: "env", provider: "default", id: "TAVILY_API_KEY" },

2214+

},

2215+

},

2216+

},

2217+

},

2218+

},

2219+

};

2220+

const resolvedConfig = {

2221+

...rawConfig,

2222+

tools: { web: { search: { provider: "tavily" } } },

2223+

plugins: {

2224+

entries: {

2225+

tavily: { config: { webSearch: { apiKey: "resolved-tavily-key" } } },

2226+

},

2227+

},

2228+

};

2229+

const targetIds = new Set(["plugins.entries.tavily.config.webSearch.apiKey"]);

2230+

const allowedPaths = new Set(["plugins.entries.tavily.config.webSearch.apiKey"]);

2231+

mocks.loadConfig.mockReturnValue(rawConfig);

2232+

mocks.getWebSearchCommandSecretTargets.mockReturnValue({

2233+

targetIds,

2234+

allowedPaths,

2235+

});

2236+

mocks.resolveCommandConfigWithSecrets.mockResolvedValueOnce({

2237+

resolvedConfig,

2238+

effectiveConfig: resolvedConfig,

2239+

diagnostics: [],

2240+

} as never);

2241+

const webSearchRuntime = await import("../web-search/runtime.js");

2242+

vi.mocked(webSearchRuntime.runWebSearch).mockResolvedValueOnce({

2243+

provider: "tavily",

2244+

result: { results: [] },

2245+

} as never);

2246+2247+

await runRegisteredCli({

2248+

register: registerCapabilityCli as (program: Command) => void,

2249+

argv: ["capability", "web", "search", "--provider", "tavily", "--query", "ping", "--json"],

2250+

});

2251+2252+

expect(firstCommandConfigResolutionCall()).toEqual(

2253+

expect.objectContaining({

2254+

commandName: "infer web search",

2255+

targetIds,

2256+

allowedPaths,

2257+

runtime: mocks.runtime,

2258+

}),

2259+

);

2260+

expect(firstCommandConfigResolutionCall()?.config).toEqual(

2261+

expect.objectContaining({

2262+

tools: { web: { search: { provider: "tavily" } } },

2263+

}),

2264+

);

2265+

expect(rawConfig.tools.web.search.provider).toBe("brave");

2266+

expect(vi.mocked(webSearchRuntime.runWebSearch).mock.calls[0]?.[0]).toEqual(

2267+

expect.objectContaining({

2268+

config: resolvedConfig,

2269+

preferInputConfig: true,

2270+

providerId: "tavily",

2271+

}),

2272+

);

2273+

});

2274+2275+

it("resolves command SecretRefs before local web fetch execution", async () => {

2276+

const rawConfig = {

2277+

tools: { web: { fetch: { provider: "browser" } } },

2278+

plugins: {

2279+

entries: {

2280+

firecrawl: {

2281+

config: {

2282+

webFetch: {

2283+

apiKey: { source: "env", provider: "default", id: "FIRECRAWL_API_KEY" },

2284+

},

2285+

},

2286+

},

2287+

},

2288+

},

2289+

};

2290+

const resolvedConfig = {

2291+

...rawConfig,

2292+

tools: { web: { fetch: { provider: "firecrawl" } } },

2293+

plugins: {

2294+

entries: {

2295+

firecrawl: { config: { webFetch: { apiKey: "resolved-firecrawl-key" } } },

2296+

},

2297+

},

2298+

};

2299+

const targetIds = new Set(["plugins.entries.firecrawl.config.webFetch.apiKey"]);

2300+

const allowedPaths = new Set(["plugins.entries.firecrawl.config.webFetch.apiKey"]);

2301+

mocks.loadConfig.mockReturnValue(rawConfig);

2302+

mocks.getWebFetchCommandSecretTargets.mockReturnValue({

2303+

targetIds,

2304+

allowedPaths,

2305+

});

2306+

mocks.resolveCommandConfigWithSecrets.mockResolvedValueOnce({

2307+

resolvedConfig,

2308+

effectiveConfig: resolvedConfig,

2309+

diagnostics: [],

2310+

} as never);

2311+

const webFetchRuntime = await import("../web-fetch/runtime.js");

2312+

const execute = vi.fn(async () => ({ text: "ok" }));

2313+

vi.mocked(webFetchRuntime.resolveWebFetchDefinition).mockReturnValueOnce({

2314+

provider: { id: "firecrawl" },

2315+

definition: { execute },

2316+

} as never);

2317+2318+

await runRegisteredCli({

2319+

register: registerCapabilityCli as (program: Command) => void,

2320+

argv: [

2321+

"capability",

2322+

"web",

2323+

"fetch",

2324+

"--provider",

2325+

"firecrawl",

2326+

"--url",

2327+

"https://example.com",

2328+

"--json",

2329+

],

2330+

});

2331+2332+

expect(firstCommandConfigResolutionCall()).toEqual(

2333+

expect.objectContaining({

2334+

commandName: "infer web fetch",

2335+

targetIds,

2336+

allowedPaths,

2337+

runtime: mocks.runtime,

2338+

}),

2339+

);

2340+

expect(firstCommandConfigResolutionCall()?.config).toEqual(

2341+

expect.objectContaining({

2342+

tools: { web: { fetch: { provider: "firecrawl" } } },

2343+

}),

2344+

);

2345+

expect(rawConfig.tools.web.fetch.provider).toBe("browser");

2346+

expect(vi.mocked(webFetchRuntime.resolveWebFetchDefinition).mock.calls[0]?.[0]).toEqual(

2347+

expect.objectContaining({

2348+

config: resolvedConfig,

2349+

providerId: "firecrawl",

2350+

}),

2351+

);

2352+

expect(execute).toHaveBeenCalledWith({

2353+

url: "https://example.com",

2354+

format: undefined,

2355+

});

2356+

});

2357+21012358

it("surfaces selected and configured embedding provider state", async () => {

21022359

mocks.loadConfig.mockReturnValue({});

21032360

mocks.resolveMemorySearchConfig.mockReturnValue({