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

推荐订阅源

Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
V
V2EX
量子位
Last Week in AI
Last Week in AI
Jina AI
Jina AI
博客园 - 【当耐特】
爱范儿
爱范儿
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
小众软件
小众软件
IT之家
IT之家
博客园_首页
博客园 - 聂微东
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗

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(browser): add pageReady to Chrome MCP existing-sessio...
ai-hpc · 2026-05-11 · via Recent Commits to openclaw:main

@@ -9,9 +9,9 @@ const { BrowserProfileUnavailableError } = await import("../errors.js");

99

const { registerBrowserBasicRoutes } = await import("./basic.js");

10101111

function createExistingSessionProfileState(params?: {

12-

isHttpReachable?: () => Promise<boolean>;

13-

isTransportAvailable?: () => Promise<boolean>;

14-

isReachable?: () => Promise<boolean>;

12+

isHttpReachable?: (timeoutMs?: number) => Promise<boolean>;

13+

isTransportAvailable?: (timeoutMs?: number) => Promise<boolean>;

14+

isReachable?: (timeoutMs?: number, options?: { ephemeral?: boolean }) => Promise<boolean>;

1515

}) {

1616

return {

1717

resolved: {

@@ -276,7 +276,7 @@ describe("basic browser routes", () => {

276276

expect(ensureBrowserAvailable).not.toHaveBeenCalled();

277277

});

278278279-

it("treats attach-only profiles as running when transport is available even if page reachability is false", async () => {

279+

it("reports pageReady=false when Chrome MCP transport is up but page tools are unreachable", async () => {

280280

const response = await callBasicRouteWithState({

281281

state: createExistingSessionProfileState({

282282

isTransportAvailable: async () => true,

@@ -291,26 +291,81 @@ describe("basic browser routes", () => {

291291

expect(body.transport).toBe("chrome-mcp");

292292

expect(body.running).toBe(true);

293293

expect(body.cdpReady).toBe(true);

294+

expect(body.pageReady).toBe(false);

294295

});

295296296-

it("probes Chrome MCP transport only once for status", async () => {

297+

it("reports pageReady=false when the page-reachability probe throws", async () => {

298+

const response = await callBasicRouteWithState({

299+

state: createExistingSessionProfileState({

300+

isTransportAvailable: async () => true,

301+

isReachable: async () => {

302+

throw new Error('Chrome MCP "list_pages" timed out after 5000ms.');

303+

},

304+

}),

305+

});

306+307+

expect(response.statusCode).toBe(200);

308+

const body = responseBodyRecord(response);

309+

expect(body.cdpReady).toBe(true);

310+

expect(body.pageReady).toBe(false);

311+

});

312+313+

it("reports pageReady=true when both transport and page tools succeed", async () => {

297314

const isHttpReachable = vi.fn(async () => true);

298315

const isTransportAvailable = vi.fn(async () => true);

316+

const isReachable = vi.fn(async () => true);

299317300318

const response = await callBasicRouteWithState({

301319

state: createExistingSessionProfileState({

302320

isHttpReachable,

303321

isTransportAvailable,

322+

isReachable,

304323

}),

305324

});

306325307326

expect(response.statusCode).toBe(200);

308327

expect(isTransportAvailable).toHaveBeenCalledTimes(1);

309328

expect(isTransportAvailable).toHaveBeenCalledWith(5_000);

329+

expect(isReachable).toHaveBeenCalledWith(5_000, { ephemeral: true });

310330

expect(isHttpReachable).not.toHaveBeenCalled();

311331

const body = responseBodyRecord(response);

312332

expect(body.cdpHttp).toBe(true);

313333

expect(body.cdpReady).toBe(true);

334+

expect(body.pageReady).toBe(true);

314335

expect(body.running).toBe(true);

315336

});

337+338+

it("page-readiness probe runs in ephemeral mode so status does not seed a cached session", async () => {

339+

const isReachable = vi.fn<

340+

(timeoutMs?: number, options?: { ephemeral?: boolean }) => Promise<boolean>

341+

>(async () => true);

342+343+

await callBasicRouteWithState({

344+

state: createExistingSessionProfileState({

345+

isTransportAvailable: async () => true,

346+

isReachable,

347+

}),

348+

});

349+350+

expect(isReachable).toHaveBeenCalledTimes(1);

351+

expect(isReachable.mock.calls[0]?.[1]).toEqual({ ephemeral: true });

352+

});

353+354+

it("skips the page-reachability probe when transport is unavailable", async () => {

355+

const isReachable = vi.fn(async () => true);

356+357+

const response = await callBasicRouteWithState({

358+

state: createExistingSessionProfileState({

359+

isTransportAvailable: async () => false,

360+

isReachable,

361+

}),

362+

});

363+364+

expect(response.statusCode).toBe(200);

365+

expect(isReachable).not.toHaveBeenCalled();

366+

const body = responseBodyRecord(response);

367+

expect(body.cdpReady).toBe(false);

368+

expect(body.pageReady).toBe(false);

369+

expect(body.running).toBe(false);

370+

});

316371

});