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

推荐订阅源

Last Week in AI
Last Week in AI
D
DataBreaches.Net
腾讯CDC
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
月光博客
月光博客
MyScale Blog
MyScale Blog
U
Unit 42
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园 - 【当耐特】
D
Docker
I
InfoQ
雷峰网
雷峰网

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
refactor(xai): drop unused sync tool auth helper · opencl...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -4,7 +4,6 @@ import { afterEach, describe, expect, it, vi } from "vitest";

44

import {

55

isXaiToolEnabled,

66

resolveFallbackXaiAuth,

7-

resolveXaiToolApiKey,

87

resolveXaiToolApiKeyWithAuth,

98

} from "./tool-auth-shared.js";

109

@@ -81,11 +80,11 @@ describe("xai tool auth helpers", () => {

8180

});

8281

});

838284-

it("falls back to runtime, then source config, then env for tool auth", () => {

83+

it("falls back to runtime, then source config, then env for tool auth", async () => {

8584

vi.stubEnv("XAI_API_KEY", "env-key");

868587-

expect(

88-

resolveXaiToolApiKey({

86+

await expect(

87+

resolveXaiToolApiKeyWithAuth({

8988

runtimeConfig: {

9089

plugins: {

9190

entries: {

@@ -113,10 +112,10 @@ describe("xai tool auth helpers", () => {

113112

},

114113

},

115114

}),

116-

).toBe("runtime-key");

115+

).resolves.toBe("runtime-key");

117116118-

expect(

119-

resolveXaiToolApiKey({

117+

await expect(

118+

resolveXaiToolApiKeyWithAuth({

120119

sourceConfig: {

121120

plugins: {

122121

entries: {

@@ -131,9 +130,9 @@ describe("xai tool auth helpers", () => {

131130

},

132131

},

133132

}),

134-

).toBe("source-key");

133+

).resolves.toBe("source-key");

135134136-

expect(resolveXaiToolApiKey({})).toBe("env-key");

135+

await expect(resolveXaiToolApiKeyWithAuth({})).resolves.toBe("env-key");

137136

});

138137139138

it("honors explicit disabled flags before auth fallback", () => {

@@ -153,11 +152,11 @@ describe("xai tool auth helpers", () => {

153152

await expect(resolveXaiToolApiKeyWithAuth({ auth })).resolves.toBe("profile-key");

154153

});

155154156-

it("does not use env fallback when a non-env SecretRef is configured but unavailable", () => {

155+

it("does not use env fallback when a non-env SecretRef is configured but unavailable", async () => {

157156

vi.stubEnv("XAI_API_KEY", "env-key");

158157159-

expect(

160-

resolveXaiToolApiKey({

158+

await expect(

159+

resolveXaiToolApiKeyWithAuth({

161160

sourceConfig: {

162161

plugins: {

163162

entries: {

@@ -176,7 +175,7 @@ describe("xai tool auth helpers", () => {

176175

},

177176

},

178177

}),

179-

).toBeUndefined();

178+

).resolves.toBeUndefined();

180179

});

181180182181

it("does not bypass blocked explicit tool config with auth profiles", async () => {

@@ -207,11 +206,11 @@ describe("xai tool auth helpers", () => {

207206

await expect(resolveXaiToolApiKeyWithAuth({ sourceConfig, auth })).resolves.toBeUndefined();

208207

});

209208210-

it("resolves env SecretRefs from source config when runtime snapshot is unavailable", () => {

209+

it("resolves env SecretRefs from source config when runtime snapshot is unavailable", async () => {

211210

vi.stubEnv("XAI_API_KEY", "xai-secretref-key");

212211213-

expect(

214-

resolveXaiToolApiKey({

212+

await expect(

213+

resolveXaiToolApiKeyWithAuth({

215214

sourceConfig: {

216215

plugins: {

217216

entries: {

@@ -230,14 +229,14 @@ describe("xai tool auth helpers", () => {

230229

},

231230

},

232231

}),

233-

).toBe("xai-secretref-key");

232+

).resolves.toBe("xai-secretref-key");

234233

});

235234236-

it("does not read arbitrary env SecretRef ids for xAI tool auth", () => {

235+

it("does not read arbitrary env SecretRef ids for xAI tool auth", async () => {

237236

vi.stubEnv("UNRELATED_SECRET", "should-not-be-read");

238237239-

expect(

240-

resolveXaiToolApiKey({

238+

await expect(

239+

resolveXaiToolApiKeyWithAuth({

241240

sourceConfig: {

242241

plugins: {

243242

entries: {

@@ -256,14 +255,14 @@ describe("xai tool auth helpers", () => {

256255

},

257256

},

258257

}),

259-

).toBeUndefined();

258+

).resolves.toBeUndefined();

260259

});

261260262-

it("does not resolve env SecretRefs when provider allowlist excludes XAI_API_KEY", () => {

261+

it("does not resolve env SecretRefs when provider allowlist excludes XAI_API_KEY", async () => {

263262

vi.stubEnv("XAI_API_KEY", "xai-secretref-key");

264263265-

expect(

266-

resolveXaiToolApiKey({

264+

await expect(

265+

resolveXaiToolApiKeyWithAuth({

267266

sourceConfig: {

268267

secrets: {

269268

providers: {

@@ -290,14 +289,14 @@ describe("xai tool auth helpers", () => {

290289

},

291290

},

292291

}),

293-

).toBeUndefined();

292+

).resolves.toBeUndefined();

294293

});

295294296-

it("does not resolve env SecretRefs when provider source is not env", () => {

295+

it("does not resolve env SecretRefs when provider source is not env", async () => {

297296

vi.stubEnv("XAI_API_KEY", "xai-secretref-key");

298297299-

expect(

300-

resolveXaiToolApiKey({

298+

await expect(

299+

resolveXaiToolApiKeyWithAuth({

301300

sourceConfig: {

302301

secrets: {

303302

providers: {

@@ -324,6 +323,6 @@ describe("xai tool auth helpers", () => {

324323

},

325324

},

326325

}),

327-

).toBeUndefined();

326+

).resolves.toBeUndefined();

328327

});

329328

});