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

推荐订阅源

Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
B
Blog
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
爱范儿
爱范儿
博客园_首页
博客园 - 聂微东
量子位
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
The Cloudflare Blog
T
Tailwind CSS Blog
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
腾讯CDC

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: tighten web search late bind assertions · openclaw/...
shakkernerd · 2026-05-09 · via Recent Commits to openclaw:main

@@ -24,6 +24,28 @@ vi.mock("../../secrets/runtime.js", () => ({

2424

getActiveSecretsRuntimeSnapshot: mocks.getActiveSecretsRuntimeSnapshot,

2525

}));

262627+

type RunWebSearchParams = {

28+

config?: unknown;

29+

preferRuntimeProviders?: boolean;

30+

runtimeWebSearch?: {

31+

selectedProvider?: string;

32+

};

33+

};

34+35+

type ProviderResolutionParams = {

36+

value?: string;

37+

};

38+39+

function firstRunWebSearchParams(): RunWebSearchParams | undefined {

40+

return mocks.runWebSearch.mock.calls[0]?.[0] as RunWebSearchParams | undefined;

41+

}

42+43+

function firstProviderResolutionParams(): ProviderResolutionParams | undefined {

44+

return mocks.resolveManifestContractOwnerPluginId.mock.calls[0]?.[0] as

45+

| ProviderResolutionParams

46+

| undefined;

47+

}

48+2749

describe("web_search late-bound runtime fallback", () => {

2850

beforeEach(() => {

2951

mocks.runWebSearch.mockReset();

@@ -54,11 +76,7 @@ describe("web_search late-bound runtime fallback", () => {

54765577

await tool?.execute("call-search", { query: "openclaw" }, undefined);

567857-

expect(mocks.runWebSearch).toHaveBeenCalledWith(

58-

expect.objectContaining({

59-

runtimeWebSearch: expect.objectContaining({ selectedProvider: "brave" }),

60-

}),

61-

);

79+

expect(firstRunWebSearchParams()?.runtimeWebSearch?.selectedProvider).toBe("brave");

6280

});

63816482

it("falls back to options.config when getActiveSecretsRuntimeSnapshot is null", async () => {

@@ -73,11 +91,7 @@ describe("web_search late-bound runtime fallback", () => {

73917492

await tool?.execute("call-search", { query: "openclaw" }, undefined);

759376-

expect(mocks.runWebSearch).toHaveBeenCalledWith(

77-

expect.objectContaining({

78-

config: fallbackConfig,

79-

}),

80-

);

94+

expect(firstRunWebSearchParams()?.config).toBe(fallbackConfig);

8195

});

82968397

it("uses configured provider id from config when no runtime selection is present", async () => {

@@ -92,12 +106,8 @@ describe("web_search late-bound runtime fallback", () => {

9210693107

await tool?.execute("call-search", { query: "openclaw" }, undefined);

9410895-

expect(mocks.resolveManifestContractOwnerPluginId).toHaveBeenCalledWith(

96-

expect.objectContaining({ value: "brave" }),

97-

);

98-

expect(mocks.runWebSearch).toHaveBeenCalledWith(

99-

expect.objectContaining({ preferRuntimeProviders: true }),

100-

);

109+

expect(firstProviderResolutionParams()?.value).toBe("brave");

110+

expect(firstRunWebSearchParams()?.preferRuntimeProviders).toBe(true);

101111

});

102112103113

it("keeps runtime provider discovery enabled when no provider id is selected anywhere", async () => {

@@ -110,9 +120,7 @@ describe("web_search late-bound runtime fallback", () => {

110120

await tool?.execute("call-search", { query: "openclaw" }, undefined);

111121112122

expect(mocks.resolveManifestContractOwnerPluginId).not.toHaveBeenCalled();

113-

expect(mocks.runWebSearch).toHaveBeenCalledWith(

114-

expect.objectContaining({ preferRuntimeProviders: true }),

115-

);

123+

expect(firstRunWebSearchParams()?.preferRuntimeProviders).toBe(true);

116124

});

117125118126

it("does not prefer runtime providers when the configured provider is a bundled manifest owner", async () => {

@@ -128,9 +136,7 @@ describe("web_search late-bound runtime fallback", () => {

128136129137

await tool?.execute("call-search", { query: "openclaw" }, undefined);

130138131-

expect(mocks.runWebSearch).toHaveBeenCalledWith(

132-

expect.objectContaining({ preferRuntimeProviders: false }),

133-

);

139+

expect(firstRunWebSearchParams()?.preferRuntimeProviders).toBe(false);

134140

});

135141136142

it("prefers active runtime metadata over options.runtimeWebSearch when present", async () => {

@@ -156,11 +162,7 @@ describe("web_search late-bound runtime fallback", () => {

156162157163

await tool?.execute("call-search", { query: "openclaw" }, undefined);

158164159-

expect(mocks.runWebSearch).toHaveBeenCalledWith(

160-

expect.objectContaining({

161-

runtimeWebSearch: expect.objectContaining({ selectedProvider: "perplexity" }),

162-

}),

163-

);

165+

expect(firstRunWebSearchParams()?.runtimeWebSearch?.selectedProvider).toBe("perplexity");

164166

});

165167166168

it("honors late-bound disabled search config at execute time", async () => {