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

推荐订阅源

Forbes - Security
Forbes - Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
B
Blog
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
Recent Announcements
Recent Announcements
U
Unit 42
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Register - Security
The Register - Security
Recorded Future
Recorded Future
C
Check Point Blog
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
F
Full Disclosure
小众软件
小众软件
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
爱范儿
爱范儿
P
Proofpoint News Feed
罗磊的独立博客
量子位
D
Docker
博客园_首页
D
DataBreaches.Net
Project Zero
Project Zero
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - Franky
Security Latest
Security Latest
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
Netflix TechBlog - Medium
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
大猫的无限游戏
大猫的无限游戏

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(whatsapp): recover stale listener after auth conflict churn (#72621) · openclaw/openclaw@7950a18
vincentkoc · 2026-04-28 · via Recent Commits to openclaw:main

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

1818

waitForCredsSaveQueueWithTimeout: vi.fn<() => Promise<CredsQueueWaitResult>>(

1919

async () => "drained",

2020

),

21+

oauthDir: "/tmp/openclaw-wa-auth-store-test-oauth",

2122

}));

22232324

vi.mock("./creds-persistence.js", async () => {

@@ -29,12 +30,31 @@ vi.mock("./creds-persistence.js", async () => {

2930

};

3031

});

313233+

vi.mock("./auth-store.runtime.js", () => ({

34+

resolveOAuthDir: () => hoisted.oauthDir,

35+

}));

36+3237

function createTempAuthDir(prefix: string) {

3338

return fsSync.mkdtempSync(

3439

path.join((process.env.TMPDIR ?? "/tmp").replace(/\/+$/, ""), `${prefix}-`),

3540

);

3641

}

374243+

function withOwnedOAuthAuthDir<T>(

44+

prefix: string,

45+

run: (authDir: string) => Promise<T>,

46+

): Promise<T> {

47+

const previousOAuthDir = hoisted.oauthDir;

48+

const oauthDir = createTempAuthDir(`${prefix}-oauth`);

49+

const authDir = path.join(oauthDir, "whatsapp", "default");

50+

fsSync.mkdirSync(authDir, { recursive: true });

51+

hoisted.oauthDir = oauthDir;

52+

return run(authDir).finally(() => {

53+

hoisted.oauthDir = previousOAuthDir;

54+

fsSync.rmSync(oauthDir, { recursive: true, force: true });

55+

});

56+

}

57+3858

describe("auth-store", () => {

3959

beforeEach(() => {

4060

hoisted.waitForCredsSaveQueueWithTimeout.mockReset().mockResolvedValue("drained");

@@ -115,29 +135,32 @@ describe("auth-store", () => {

115135

});

116136117137

it("clears unreadable auth state on explicit logout", async () => {

118-

const authDir = createTempAuthDir("openclaw-wa-auth-logout");

119-

fsSync.writeFileSync(path.join(authDir, "creds.json"), "{", "utf-8");

120-

fsSync.writeFileSync(

121-

path.join(authDir, "creds.json.bak"),

122-

JSON.stringify({ me: { id: "123@s.whatsapp.net" } }),

123-

"utf-8",

124-

);

138+

await withOwnedOAuthAuthDir("openclaw-wa-auth-logout", async (authDir) => {

139+

fsSync.writeFileSync(path.join(authDir, "creds.json"), "{", "utf-8");

140+

fsSync.writeFileSync(

141+

path.join(authDir, "creds.json.bak"),

142+

JSON.stringify({ me: { id: "123@s.whatsapp.net" } }),

143+

"utf-8",

144+

);

125145126-

const runtime = {

127-

log: vi.fn(),

128-

error: vi.fn(),

129-

exit: vi.fn(),

130-

};

146+

const runtime = {

147+

log: vi.fn(),

148+

error: vi.fn(),

149+

exit: vi.fn(),

150+

};

131151132-

await expect(logoutWeb({ authDir, runtime: runtime as never })).resolves.toBe(true);

133-

expect(fsSync.existsSync(authDir)).toBe(false);

152+

await expect(logoutWeb({ authDir, runtime: runtime as never })).resolves.toBe(true);

153+

expect(fsSync.existsSync(authDir)).toBe(false);

154+

});

134155

});

135156136157

it("does not delete the whole legacy auth root when targeted cleanup fails", async () => {

137158

const authDir = createTempAuthDir("openclaw-wa-auth-legacy-failure");

159+

const previousOAuthDir = hoisted.oauthDir;

138160

fsSync.writeFileSync(path.join(authDir, "creds.json"), "{}", "utf-8");

139161

fsSync.writeFileSync(path.join(authDir, "oauth.json"), '{"token":true}', "utf-8");

140162

fsSync.writeFileSync(path.join(authDir, "session-abc.json"), "{}", "utf-8");

163+

hoisted.oauthDir = authDir;

141164

const originalRm = fs.rm;

142165

const rmSpy = vi.spyOn(fs, "rm").mockImplementation(async (target, options) => {

143166

if (String(target).endsWith("creds.json")) {

@@ -151,29 +174,114 @@ describe("auth-store", () => {

151174

exit: vi.fn(),

152175

};

153176154-

await expect(

155-

logoutWeb({ authDir, isLegacyAuthDir: true, runtime: runtime as never }),

156-

).rejects.toThrow("EACCES");

157-

expect(fsSync.existsSync(authDir)).toBe(true);

158-

expect(fsSync.existsSync(path.join(authDir, "oauth.json"))).toBe(true);

159-

rmSpy.mockRestore();

177+

try {

178+

await expect(

179+

logoutWeb({ authDir, isLegacyAuthDir: true, runtime: runtime as never }),

180+

).rejects.toThrow("EACCES");

181+

expect(fsSync.existsSync(authDir)).toBe(true);

182+

expect(fsSync.existsSync(path.join(authDir, "oauth.json"))).toBe(true);

183+

} finally {

184+

hoisted.oauthDir = previousOAuthDir;

185+

rmSpy.mockRestore();

186+

fsSync.rmSync(authDir, { recursive: true, force: true });

187+

}

160188

});

161189162190

it("clears auth state even when directory enumeration fails", async () => {

163-

const authDir = createTempAuthDir("openclaw-wa-auth-readdir");

191+

await withOwnedOAuthAuthDir("openclaw-wa-auth-readdir", async (authDir) => {

192+

fsSync.writeFileSync(path.join(authDir, "creds.json"), "{}", "utf-8");

193+

const readdirSpy = vi

194+

.spyOn(fs, "readdir")

195+

.mockRejectedValueOnce(Object.assign(new Error("EACCES"), { code: "EACCES" }));

196+

const runtime = {

197+

log: vi.fn(),

198+

error: vi.fn(),

199+

exit: vi.fn(),

200+

};

201+202+

await expect(logoutWeb({ authDir, runtime: runtime as never })).resolves.toBe(true);

203+

expect(fsSync.existsSync(authDir)).toBe(false);

204+

readdirSpy.mockRestore();

205+

});

206+

});

207+208+

it("does not delete custom auth directories outside the OpenClaw auth root", async () => {

209+

const authDir = createTempAuthDir("openclaw-wa-auth-custom");

210+

const nestedDir = path.join(authDir, "nested");

211+

fsSync.mkdirSync(nestedDir);

164212

fsSync.writeFileSync(path.join(authDir, "creds.json"), "{}", "utf-8");

165-

const readdirSpy = vi

166-

.spyOn(fs, "readdir")

167-

.mockRejectedValueOnce(Object.assign(new Error("EACCES"), { code: "EACCES" }));

213+

fsSync.writeFileSync(path.join(authDir, "notes.txt"), "keep me", "utf-8");

214+

fsSync.writeFileSync(path.join(nestedDir, "session-abc.json"), "keep me", "utf-8");

168215

const runtime = {

169216

log: vi.fn(),

170217

error: vi.fn(),

171218

exit: vi.fn(),

172219

};

173220174-

await expect(logoutWeb({ authDir, runtime: runtime as never })).resolves.toBe(true);

175-

expect(fsSync.existsSync(authDir)).toBe(false);

176-

readdirSpy.mockRestore();

221+

await expect(logoutWeb({ authDir, runtime: runtime as never })).resolves.toBe(false);

222+

expect(fsSync.existsSync(authDir)).toBe(true);

223+

expect(fsSync.existsSync(path.join(authDir, "creds.json"))).toBe(true);

224+

expect(fsSync.existsSync(path.join(authDir, "notes.txt"))).toBe(true);

225+

expect(fsSync.existsSync(path.join(nestedDir, "session-abc.json"))).toBe(true);

226+

});

227+228+

it("does not clear auth files through a symlinked owned auth directory", async () => {

229+

const previousOAuthDir = hoisted.oauthDir;

230+

const oauthDir = createTempAuthDir("openclaw-wa-auth-symlink-oauth");

231+

const externalDir = createTempAuthDir("openclaw-wa-auth-symlink-target");

232+

const authDir = path.join(oauthDir, "whatsapp", "default");

233+

try {

234+

fsSync.mkdirSync(path.dirname(authDir), { recursive: true });

235+

fsSync.writeFileSync(path.join(externalDir, "creds.json"), "{}", "utf-8");

236+

fsSync.writeFileSync(path.join(externalDir, "notes.txt"), "keep me", "utf-8");

237+

fsSync.symlinkSync(externalDir, authDir, "dir");

238+

hoisted.oauthDir = oauthDir;

239+

const runtime = {

240+

log: vi.fn(),

241+

error: vi.fn(),

242+

exit: vi.fn(),

243+

};

244+245+

await expect(logoutWeb({ authDir, runtime: runtime as never })).resolves.toBe(false);

246+

expect(fsSync.existsSync(authDir)).toBe(true);

247+

expect(fsSync.existsSync(path.join(externalDir, "creds.json"))).toBe(true);

248+

expect(fsSync.existsSync(path.join(externalDir, "notes.txt"))).toBe(true);

249+

} finally {

250+

hoisted.oauthDir = previousOAuthDir;

251+

fsSync.rmSync(oauthDir, { recursive: true, force: true });

252+

fsSync.rmSync(externalDir, { recursive: true, force: true });

253+

}

254+

});

255+256+

it("does not clear auth files through an intermediate symlink in the owned auth tree", async () => {

257+

const previousOAuthDir = hoisted.oauthDir;

258+

const oauthDir = createTempAuthDir("openclaw-wa-auth-symlink-parent-oauth");

259+

const externalRoot = createTempAuthDir("openclaw-wa-auth-symlink-parent-target");

260+

const externalAuthDir = path.join(externalRoot, "default");

261+

const linkedParent = path.join(oauthDir, "whatsapp", "linked");

262+

const authDir = path.join(linkedParent, "default");

263+

try {

264+

fsSync.mkdirSync(path.dirname(linkedParent), { recursive: true });

265+

fsSync.mkdirSync(externalAuthDir, { recursive: true });

266+

fsSync.writeFileSync(path.join(externalAuthDir, "creds.json"), "{}", "utf-8");

267+

fsSync.writeFileSync(path.join(externalAuthDir, "notes.txt"), "keep me", "utf-8");

268+

fsSync.symlinkSync(externalRoot, linkedParent, "dir");

269+

hoisted.oauthDir = oauthDir;

270+

const runtime = {

271+

log: vi.fn(),

272+

error: vi.fn(),

273+

exit: vi.fn(),

274+

};

275+276+

await expect(logoutWeb({ authDir, runtime: runtime as never })).resolves.toBe(false);

277+

expect(fsSync.existsSync(authDir)).toBe(true);

278+

expect(fsSync.existsSync(path.join(externalAuthDir, "creds.json"))).toBe(true);

279+

expect(fsSync.existsSync(path.join(externalAuthDir, "notes.txt"))).toBe(true);

280+

} finally {

281+

hoisted.oauthDir = previousOAuthDir;

282+

fsSync.rmSync(oauthDir, { recursive: true, force: true });

283+

fsSync.rmSync(externalRoot, { recursive: true, force: true });

284+

}

177285

});

178286179287

it("does not delete unrelated non-empty directories on logout", async () => {