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

推荐订阅源

Y
Y Combinator Blog
腾讯CDC
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
博客园_首页
D
DataBreaches.Net
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
月光博客
月光博客
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Vercel News
Vercel News
WordPress大学
WordPress大学
J
Java Code Geeks
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42

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: preserve xAI web search credential fallback (#85182)...
steipete · 2026-05-22 · via Recent Commits to openclaw:main

@@ -14,105 +14,107 @@ vi.mock("../plugin-sdk/telegram-command-config.js", () => ({

1414

resolveTelegramCustomCommands: () => ({ commands: [], issues: [] }),

1515

}));

161617-

const getScopedWebSearchCredential = (key: string) => (search?: Record<string, unknown>) =>

18-

(search?.[key] as { apiKey?: unknown } | undefined)?.apiKey;

19-

const getConfiguredPluginWebSearchConfig =

20-

(pluginId: string) => (config?: Record<string, unknown>) =>

21-

(

22-

config?.plugins as

23-

| {

24-

entries?: Record<

25-

string,

26-

{ config?: { webSearch?: { apiKey?: unknown; baseUrl?: unknown } } }

27-

>;

28-

}

29-

| undefined

30-

)?.entries?.[pluginId]?.config?.webSearch;

31-

const getConfiguredPluginWebSearchCredential =

32-

(pluginId: string) => (config?: Record<string, unknown>) =>

33-

getConfiguredPluginWebSearchConfig(pluginId)(config)?.apiKey;

34-35-

const mockWebSearchProviders = [

36-

{

37-

id: "brave",

38-

pluginId: "brave",

39-

envVars: ["BRAVE_API_KEY"],

40-

credentialPath: "plugins.entries.brave.config.webSearch.apiKey",

41-

getCredentialValue: (search?: Record<string, unknown>) => search?.apiKey,

42-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("brave"),

43-

},

44-

{

45-

id: "firecrawl",

46-

pluginId: "firecrawl",

47-

envVars: ["FIRECRAWL_API_KEY"],

48-

credentialPath: "plugins.entries.firecrawl.config.webSearch.apiKey",

49-

getCredentialValue: getScopedWebSearchCredential("firecrawl"),

50-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("firecrawl"),

51-

},

52-

{

53-

id: "gemini",

54-

pluginId: "google",

55-

envVars: ["GEMINI_API_KEY"],

56-

credentialPath: "plugins.entries.google.config.webSearch.apiKey",

57-

getCredentialValue: getScopedWebSearchCredential("gemini"),

58-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("google"),

59-

},

60-

{

61-

id: "grok",

62-

pluginId: "xai",

63-

envVars: ["XAI_API_KEY"],

64-

credentialPath: "plugins.entries.xai.config.webSearch.apiKey",

65-

getCredentialValue: getScopedWebSearchCredential("grok"),

66-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("xai"),

67-

},

68-

{

69-

id: "kimi",

70-

pluginId: "moonshot",

71-

envVars: ["KIMI_API_KEY", "MOONSHOT_API_KEY"],

72-

credentialPath: "plugins.entries.moonshot.config.webSearch.apiKey",

73-

getCredentialValue: getScopedWebSearchCredential("kimi"),

74-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("moonshot"),

75-

},

76-

{

77-

id: "minimax",

78-

pluginId: "minimax",

79-

envVars: [

80-

"MINIMAX_CODE_PLAN_KEY",

81-

"MINIMAX_CODING_API_KEY",

82-

"MINIMAX_OAUTH_TOKEN",

83-

"MINIMAX_API_KEY",

84-

],

85-

credentialPath: "plugins.entries.minimax.config.webSearch.apiKey",

86-

getCredentialValue: getScopedWebSearchCredential("minimax"),

87-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("minimax"),

88-

},

89-

{

90-

id: "perplexity",

91-

pluginId: "perplexity",

92-

envVars: ["PERPLEXITY_API_KEY", "OPENROUTER_API_KEY"],

93-

credentialPath: "plugins.entries.perplexity.config.webSearch.apiKey",

94-

getCredentialValue: getScopedWebSearchCredential("perplexity"),

95-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("perplexity"),

96-

},

97-

{

98-

id: "searxng",

99-

pluginId: "searxng",

100-

envVars: ["SEARXNG_BASE_URL"],

101-

credentialPath: "plugins.entries.searxng.config.webSearch.baseUrl",

102-

getCredentialValue: (search?: Record<string, unknown>) =>

103-

(search?.searxng as { baseUrl?: unknown } | undefined)?.baseUrl,

104-

getConfiguredCredentialValue: (config?: Record<string, unknown>) =>

105-

getConfiguredPluginWebSearchConfig("searxng")(config)?.baseUrl,

106-

},

107-

{

108-

id: "tavily",

109-

pluginId: "tavily",

110-

envVars: ["TAVILY_API_KEY"],

111-

credentialPath: "plugins.entries.tavily.config.webSearch.apiKey",

112-

getCredentialValue: getScopedWebSearchCredential("tavily"),

113-

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("tavily"),

114-

},

115-

] as const;

17+

const mockWebSearchProviders = vi.hoisted(() => {

18+

const getScopedWebSearchCredential = (key: string) => (search?: Record<string, unknown>) =>

19+

(search?.[key] as { apiKey?: unknown } | undefined)?.apiKey;

20+

const getConfiguredPluginWebSearchConfig =

21+

(pluginId: string) => (config?: Record<string, unknown>) =>

22+

(

23+

config?.plugins as

24+

| {

25+

entries?: Record<

26+

string,

27+

{ config?: { webSearch?: { apiKey?: unknown; baseUrl?: unknown } } }

28+

>;

29+

}

30+

| undefined

31+

)?.entries?.[pluginId]?.config?.webSearch;

32+

const getConfiguredPluginWebSearchCredential =

33+

(pluginId: string) => (config?: Record<string, unknown>) =>

34+

getConfiguredPluginWebSearchConfig(pluginId)(config)?.apiKey;

35+36+

return [

37+

{

38+

id: "brave",

39+

pluginId: "brave",

40+

envVars: ["BRAVE_API_KEY"],

41+

credentialPath: "plugins.entries.brave.config.webSearch.apiKey",

42+

getCredentialValue: (search?: Record<string, unknown>) => search?.apiKey,

43+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("brave"),

44+

},

45+

{

46+

id: "firecrawl",

47+

pluginId: "firecrawl",

48+

envVars: ["FIRECRAWL_API_KEY"],

49+

credentialPath: "plugins.entries.firecrawl.config.webSearch.apiKey",

50+

getCredentialValue: getScopedWebSearchCredential("firecrawl"),

51+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("firecrawl"),

52+

},

53+

{

54+

id: "gemini",

55+

pluginId: "google",

56+

envVars: ["GEMINI_API_KEY"],

57+

credentialPath: "plugins.entries.google.config.webSearch.apiKey",

58+

getCredentialValue: getScopedWebSearchCredential("gemini"),

59+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("google"),

60+

},

61+

{

62+

id: "grok",

63+

pluginId: "xai",

64+

envVars: ["XAI_API_KEY"],

65+

credentialPath: "plugins.entries.xai.config.webSearch.apiKey",

66+

getCredentialValue: getScopedWebSearchCredential("grok"),

67+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("xai"),

68+

},

69+

{

70+

id: "kimi",

71+

pluginId: "moonshot",

72+

envVars: ["KIMI_API_KEY", "MOONSHOT_API_KEY"],

73+

credentialPath: "plugins.entries.moonshot.config.webSearch.apiKey",

74+

getCredentialValue: getScopedWebSearchCredential("kimi"),

75+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("moonshot"),

76+

},

77+

{

78+

id: "minimax",

79+

pluginId: "minimax",

80+

envVars: [

81+

"MINIMAX_CODE_PLAN_KEY",

82+

"MINIMAX_CODING_API_KEY",

83+

"MINIMAX_OAUTH_TOKEN",

84+

"MINIMAX_API_KEY",

85+

],

86+

credentialPath: "plugins.entries.minimax.config.webSearch.apiKey",

87+

getCredentialValue: getScopedWebSearchCredential("minimax"),

88+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("minimax"),

89+

},

90+

{

91+

id: "perplexity",

92+

pluginId: "perplexity",

93+

envVars: ["PERPLEXITY_API_KEY", "OPENROUTER_API_KEY"],

94+

credentialPath: "plugins.entries.perplexity.config.webSearch.apiKey",

95+

getCredentialValue: getScopedWebSearchCredential("perplexity"),

96+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("perplexity"),

97+

},

98+

{

99+

id: "searxng",

100+

pluginId: "searxng",

101+

envVars: ["SEARXNG_BASE_URL"],

102+

credentialPath: "plugins.entries.searxng.config.webSearch.baseUrl",

103+

getCredentialValue: (search?: Record<string, unknown>) =>

104+

(search?.searxng as { baseUrl?: unknown } | undefined)?.baseUrl,

105+

getConfiguredCredentialValue: (config?: Record<string, unknown>) =>

106+

getConfiguredPluginWebSearchConfig("searxng")(config)?.baseUrl,

107+

},

108+

{

109+

id: "tavily",

110+

pluginId: "tavily",

111+

envVars: ["TAVILY_API_KEY"],

112+

credentialPath: "plugins.entries.tavily.config.webSearch.apiKey",

113+

getCredentialValue: getScopedWebSearchCredential("tavily"),

114+

getConfiguredCredentialValue: getConfiguredPluginWebSearchCredential("tavily"),

115+

},

116+

] as const;

117+

});

116118117119

vi.mock("../plugins/web-search-providers.runtime.js", () => {

118120

return {