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

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Schneier on Security
博客园 - 聂微东
爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
腾讯CDC
博客园 - 叶小钗
WordPress大学
WordPress大学
博客园_首页
J
Java Code Geeks
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
Schneier on Security
Schneier on Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recorded Future
Recorded Future
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
P
Privacy International News Feed
K
Kaspersky official blog
C
CERT Recently Published Vulnerability Notes
阮一峰的网络日志
阮一峰的网络日志
F
Full Disclosure
NISL@THU
NISL@THU
AWS News Blog
AWS News Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
MongoDB | Blog
MongoDB | Blog
A
Arctic Wolf
云风的 BLOG
云风的 BLOG
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threatpost
D
Docker
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
V2EX - 技术
V2EX - 技术
G
GRAHAM CLULEY
M
MIT News - Artificial intelligence
H
Heimdal Security Blog
N
News and Events Feed by Topic
P
Proofpoint News Feed

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
test: clear browser act command broad matchers · openclaw/openclaw@3ff0da7
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -112,6 +112,44 @@ async function withSymlinkPathEscape<T>(params: {

112112

}

113113

}

114114115+

type MockWithCalls = { mock: { calls: unknown[][] } };

116+117+

function isRecord(value: unknown): value is Record<string, unknown> {

118+

return typeof value === "object" && value !== null && !Array.isArray(value);

119+

}

120+121+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

122+

if (!isRecord(value)) {

123+

throw new Error(`expected ${label} to be an object`);

124+

}

125+

return value;

126+

}

127+128+

function expectRecordFields(value: unknown, label: string, expected: Record<string, unknown>) {

129+

const record = requireRecord(value, label);

130+

for (const [key, expectedValue] of Object.entries(expected)) {

131+

expect(record[key]).toEqual(expectedValue);

132+

}

133+

}

134+135+

function requireMockArg(mock: MockWithCalls, callIndex = 0, argIndex = 0) {

136+

return requireRecord(mock.mock.calls[callIndex]?.[argIndex], "mock call argument");

137+

}

138+139+

function expectBrowserCallFields(

140+

mock: MockWithCalls,

141+

expected: Record<string, unknown>,

142+

callIndex = 0,

143+

) {

144+

const arg = requireMockArg(mock, callIndex);

145+

expect(typeof arg.cdpUrl).toBe("string");

146+

expectRecordFields(arg, "browser call argument", expected);

147+

}

148+149+

function expectOkResult(result: unknown) {

150+

expect(requireRecord(result, "response").ok).toBe(true);

151+

}

152+115153

describe("browser control server", () => {

116154

installAgentContractHooks();

117155

@@ -128,14 +166,11 @@ describe("browser control server", () => {

128166

values: ["a", "b"],

129167

});

130168

expect(select.ok).toBe(true);

131-

expect(pwMocks.selectOptionViaPlaywright).toHaveBeenCalledWith(

132-

expect.objectContaining({

133-

cdpUrl: expect.any(String),

134-

targetId: "abcd1234",

135-

ref: "5",

136-

values: ["a", "b"],

137-

}),

138-

);

169+

expectBrowserCallFields(pwMocks.selectOptionViaPlaywright, {

170+

targetId: "abcd1234",

171+

ref: "5",

172+

values: ["a", "b"],

173+

});

139174140175

const fillCases: Array<{

141176

input: Record<string, unknown>;

@@ -160,12 +195,13 @@ describe("browser control server", () => {

160195

fields: [input],

161196

});

162197

expect(fill.ok).toBe(true);

163-

expect(pwMocks.fillFormViaPlaywright).toHaveBeenCalledWith(

164-

expect.objectContaining({

165-

cdpUrl: expect.any(String),

198+

expectBrowserCallFields(

199+

pwMocks.fillFormViaPlaywright,

200+

{

166201

targetId: "abcd1234",

167202

fields: [expected],

168-

}),

203+

},

204+

pwMocks.fillFormViaPlaywright.mock.calls.length - 1,

169205

);

170206

}

171207

@@ -175,14 +211,11 @@ describe("browser control server", () => {

175211

height: 600,

176212

});

177213

expect(resize.ok).toBe(true);

178-

expect(pwMocks.resizeViewportViaPlaywright).toHaveBeenCalledWith(

179-

expect.objectContaining({

180-

cdpUrl: expect.any(String),

181-

targetId: "abcd1234",

182-

width: 800,

183-

height: 600,

184-

}),

185-

);

214+

expectBrowserCallFields(pwMocks.resizeViewportViaPlaywright, {

215+

targetId: "abcd1234",

216+

width: 800,

217+

height: 600,

218+

});

186219187220

const resizeZero = await postJson<{ error?: string; code?: string }>(`${base}/act`, {

188221

kind: "resize",

@@ -207,29 +240,26 @@ describe("browser control server", () => {

207240

timeMs: 5,

208241

});

209242

expect(wait.ok).toBe(true);

210-

expect(pwMocks.waitForViaPlaywright).toHaveBeenCalledWith(

211-

expect.objectContaining({

212-

cdpUrl: state.cdpBaseUrl,

213-

targetId: "abcd1234",

214-

timeMs: 5,

215-

}),

216-

);

243+

expectBrowserCallFields(pwMocks.waitForViaPlaywright, {

244+

cdpUrl: state.cdpBaseUrl,

245+

targetId: "abcd1234",

246+

timeMs: 5,

247+

});

217248218249

const evalRes = await postJson<{ ok: boolean; result?: string }>(`${base}/act`, {

219250

kind: "evaluate",

220251

fn: "() => 1",

221252

});

222253

expect(evalRes.ok).toBe(true);

223254

expect(evalRes.result).toBe("ok");

224-

expect(pwMocks.evaluateViaPlaywright).toHaveBeenCalledWith(

225-

expect.objectContaining({

226-

cdpUrl: state.cdpBaseUrl,

227-

targetId: "abcd1234",

228-

fn: "() => 1",

229-

ref: undefined,

230-

signal: expect.any(AbortSignal),

231-

}),

232-

);

255+

const evalCall = requireMockArg(pwMocks.evaluateViaPlaywright);

256+

expectRecordFields(evalCall, "evaluate call", {

257+

cdpUrl: state.cdpBaseUrl,

258+

targetId: "abcd1234",

259+

fn: "() => 1",

260+

ref: undefined,

261+

});

262+

expect(evalCall.signal).toBeInstanceOf(AbortSignal);

233263

},

234264

slowTimeoutMs,

235265

);

@@ -252,26 +282,23 @@ describe("browser control server", () => {

252282

);

253283254284

expect(batchRes.ok).toBe(true);

255-

expect(pwMocks.batchViaPlaywright).toHaveBeenCalledWith(

256-

expect.objectContaining({

257-

cdpUrl: expect.any(String),

258-

targetId: "abcd1234",

259-

stopOnError: false,

260-

evaluateEnabled: true,

261-

actions: [

262-

{

263-

kind: "click",

264-

selector: "button.save",

265-

doubleClick: true,

266-

delayMs: 25,

267-

},

268-

{

269-

kind: "wait",

270-

fn: "() => window.ready === true",

271-

},

272-

],

273-

}),

274-

);

285+

expectBrowserCallFields(pwMocks.batchViaPlaywright, {

286+

targetId: "abcd1234",

287+

stopOnError: false,

288+

evaluateEnabled: true,

289+

actions: [

290+

{

291+

kind: "click",

292+

selector: "button.save",

293+

doubleClick: true,

294+

delayMs: 25,

295+

},

296+

{

297+

kind: "wait",

298+

fn: "() => window.ready === true",

299+

},

300+

],

301+

});

275302

},

276303

slowTimeoutMs,

277304

);

@@ -290,22 +317,20 @@ describe("browser control server", () => {

290317

});

291318292319

expect(batchRes.ok).toBe(true);

293-

expect(pwMocks.batchViaPlaywright).toHaveBeenCalledWith(

294-

expect.objectContaining({

295-

actions: [

296-

{

297-

kind: "type",

298-

selector: "input.name",

299-

text: " padded ",

300-

},

301-

{

302-

kind: "type",

303-

selector: "input.clearable",

304-

text: "",

305-

},

306-

],

307-

}),

308-

);

320+

expectRecordFields(requireMockArg(pwMocks.batchViaPlaywright), "batch call", {

321+

actions: [

322+

{

323+

kind: "type",

324+

selector: "input.name",

325+

text: " padded ",

326+

},

327+

{

328+

kind: "type",

329+

selector: "input.clearable",

330+

text: "",

331+

},

332+

],

333+

});

309334

},

310335

slowTimeoutMs,

311336

);

@@ -383,59 +408,56 @@ describe("browser control server", () => {

383408

paths: ["a.txt"],

384409

timeoutMs: 1234,

385410

});

386-

expect(upload).toMatchObject({ ok: true });

387-

expect(pwMocks.armFileUploadViaPlaywright).toHaveBeenCalledWith(

388-

expect.objectContaining({

389-

cdpUrl: expect.any(String),

390-

targetId: "abcd1234",

391-

// The server resolves paths (which adds a drive letter on Windows for `\\tmp\\...` style roots).

392-

paths: [path.resolve(DEFAULT_UPLOAD_DIR, "a.txt")],

393-

timeoutMs: 1234,

394-

}),

395-

);

411+

expectOkResult(upload);

412+

expectBrowserCallFields(pwMocks.armFileUploadViaPlaywright, {

413+

targetId: "abcd1234",

414+

// The server resolves paths (which adds a drive letter on Windows for `\\tmp\\...` style roots).

415+

paths: [path.resolve(DEFAULT_UPLOAD_DIR, "a.txt")],

416+

timeoutMs: 1234,

417+

});

396418397419

const uploadWithRef = await postJson(`${base}/hooks/file-chooser`, {

398420

paths: ["b.txt"],

399421

ref: "e12",

400422

});

401-

expect(uploadWithRef).toMatchObject({ ok: true });

423+

expectOkResult(uploadWithRef);

402424403425

const uploadWithInputRef = await postJson(`${base}/hooks/file-chooser`, {

404426

paths: ["c.txt"],

405427

inputRef: "e99",

406428

});

407-

expect(uploadWithInputRef).toMatchObject({ ok: true });

429+

expectOkResult(uploadWithInputRef);

408430409431

const uploadWithElement = await postJson(`${base}/hooks/file-chooser`, {

410432

paths: ["d.txt"],

411433

element: "input[type=file]",

412434

});

413-

expect(uploadWithElement).toMatchObject({ ok: true });

435+

expectOkResult(uploadWithElement);

414436415437

const dialog = await postJson(`${base}/hooks/dialog`, {

416438

accept: true,

417439

timeoutMs: 5678,

418440

});

419-

expect(dialog).toMatchObject({ ok: true });

441+

expectOkResult(dialog);

420442421443

const waitDownload = await postJson(`${base}/wait/download`, {

422444

path: "report.pdf",

423445

timeoutMs: 1111,

424446

});

425-

expect(waitDownload).toMatchObject({ ok: true });

447+

expectOkResult(waitDownload);

426448427449

const download = await postJson(`${base}/download`, {

428450

ref: "e12",

429451

path: "report.pdf",

430452

});

431-

expect(download).toMatchObject({ ok: true });

453+

expectOkResult(download);

432454433455

const responseBody = await postJson(`${base}/response/body`, {

434456

url: "**/api/data",

435457

timeoutMs: 2222,

436458

maxChars: 10,

437459

});

438-

expect(responseBody).toMatchObject({ ok: true });

460+

expectOkResult(responseBody);

439461440462

const consoleRes = (await realFetch(`${base}/console?level=error`).then((r) => r.json())) as {

441463

ok: boolean;

@@ -455,13 +477,11 @@ describe("browser control server", () => {

455477

});

456478

expect(shot.ok).toBe(true);

457479

expect(typeof shot.path).toBe("string");

458-

expect(pwMocks.takeScreenshotViaPlaywright).toHaveBeenCalledWith(

459-

expect.objectContaining({

460-

element: "body",

461-

type: "jpeg",

462-

timeoutMs: 3333,

463-

}),

464-

);

480+

expectRecordFields(requireMockArg(pwMocks.takeScreenshotViaPlaywright), "screenshot call", {

481+

element: "body",

482+

type: "jpeg",

483+

timeoutMs: 3333,

484+

});

465485

});

466486467487

it("blocks file chooser traversal / absolute paths outside uploads dir", async () => {

@@ -507,13 +527,12 @@ describe("browser control server", () => {

507527

});

508528

expect(res.ok).toBe(true);

509529

expect(res.path).toContain("safe-trace.zip");

510-

expect(pwMocks.traceStopViaPlaywright).toHaveBeenCalledWith(

511-

expect.objectContaining({

512-

cdpUrl: expect.any(String),

513-

targetId: "abcd1234",

514-

path: expect.stringContaining("safe-trace.zip"),

515-

}),

516-

);

530+

const traceCall = requireMockArg(pwMocks.traceStopViaPlaywright);

531+

expect(typeof traceCall.cdpUrl).toBe("string");

532+

expectRecordFields(traceCall, "trace stop call", {

533+

targetId: "abcd1234",

534+

});

535+

expect(String(traceCall.path)).toContain("safe-trace.zip");

517536

});

518537519538

it.each(guardedCurrentTabRouteCases)(

@@ -615,13 +634,12 @@ describe("browser control server", () => {

615634

},

616635

);

617636

expect(res.ok).toBe(true);

618-

expect(pwMocks.waitForDownloadViaPlaywright).toHaveBeenCalledWith(

619-

expect.objectContaining({

620-

cdpUrl: expect.any(String),

621-

targetId: "abcd1234",

622-

path: expect.stringContaining("safe-wait.pdf"),

623-

}),

624-

);

637+

const waitCall = requireMockArg(pwMocks.waitForDownloadViaPlaywright);

638+

expect(typeof waitCall.cdpUrl).toBe("string");

639+

expectRecordFields(waitCall, "wait download call", {

640+

targetId: "abcd1234",

641+

});

642+

expect(String(waitCall.path)).toContain("safe-wait.pdf");

625643

});

626644627645

it("download accepts in-root relative output path", async () => {

@@ -631,13 +649,12 @@ describe("browser control server", () => {

631649

path: "safe-download.pdf",

632650

});

633651

expect(res.ok).toBe(true);

634-

expect(pwMocks.downloadViaPlaywright).toHaveBeenCalledWith(

635-

expect.objectContaining({

636-

cdpUrl: expect.any(String),

637-

targetId: "abcd1234",

638-

ref: "e12",

639-

path: expect.stringContaining("safe-download.pdf"),

640-

}),

641-

);

652+

const downloadCall = requireMockArg(pwMocks.downloadViaPlaywright);

653+

expect(typeof downloadCall.cdpUrl).toBe("string");

654+

expectRecordFields(downloadCall, "download call", {

655+

targetId: "abcd1234",

656+

ref: "e12",

657+

});

658+

expect(String(downloadCall.path)).toContain("safe-download.pdf");

642659

});

643660

});