refactor(browser): hide cdp reachability defaults · openclaw/openclaw@46b6aa9
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,9 +27,9 @@ export const CHROME_STOP_TIMEOUT_MS = 2500;
|
27 | 27 | export const CHROME_STOP_PROBE_TIMEOUT_MS = 200; |
28 | 28 | export const CHROME_STDERR_HINT_MAX_CHARS = 2000; |
29 | 29 | |
30 | | -export const PROFILE_HTTP_REACHABILITY_TIMEOUT_MS = 300; |
31 | | -export const PROFILE_WS_REACHABILITY_MIN_TIMEOUT_MS = 200; |
32 | | -export const PROFILE_WS_REACHABILITY_MAX_TIMEOUT_MS = 2000; |
| 30 | +const PROFILE_HTTP_REACHABILITY_TIMEOUT_MS = 300; |
| 31 | +const PROFILE_WS_REACHABILITY_MIN_TIMEOUT_MS = 200; |
| 32 | +const PROFILE_WS_REACHABILITY_MAX_TIMEOUT_MS = 2000; |
33 | 33 | export const PROFILE_ATTACH_RETRY_TIMEOUT_MS = 1200; |
34 | 34 | export const PROFILE_POST_RESTART_WS_TIMEOUT_MS = 600; |
35 | 35 | export const CHROME_MCP_ATTACH_READY_WINDOW_MS = 8000; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,15 +2,14 @@
|
2 | 2 | import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime"; |
3 | 3 | import { afterEach, describe, expect, it, vi } from "vitest"; |
4 | 4 | import { resolveCdpReachabilityPolicy } from "./cdp-reachability-policy.js"; |
5 | | -import { |
6 | | -PROFILE_HTTP_REACHABILITY_TIMEOUT_MS, |
7 | | -PROFILE_WS_REACHABILITY_MAX_TIMEOUT_MS, |
8 | | -PROFILE_WS_REACHABILITY_MIN_TIMEOUT_MS, |
9 | | -resolveCdpReachabilityTimeouts, |
10 | | -} from "./cdp-timeouts.js"; |
| 5 | +import { resolveCdpReachabilityTimeouts } from "./cdp-timeouts.js"; |
11 | 6 | import type { ResolvedBrowserProfile } from "./config.js"; |
12 | 7 | import { assertBrowserNavigationAllowed } from "./navigation-guard.js"; |
13 | 8 | |
| 9 | +const PROFILE_HTTP_REACHABILITY_TIMEOUT_MS = 300; |
| 10 | +const PROFILE_WS_REACHABILITY_MIN_TIMEOUT_MS = 200; |
| 11 | +const PROFILE_WS_REACHABILITY_MAX_TIMEOUT_MS = 2000; |
| 12 | + |
14 | 13 | const fetchWithSsrFGuardMock = vi.hoisted(() => vi.fn()); |
15 | 14 | |
16 | 15 | vi.mock("openclaw/plugin-sdk/ssrf-runtime", async (importOriginal) => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,15 +3,14 @@ import type { ChildProcessWithoutNullStreams } from "node:child_process";
|
3 | 3 | import { EventEmitter } from "node:events"; |
4 | 4 | import { afterEach, describe, expect, it, vi } from "vitest"; |
5 | 5 | import "./server-context.chrome-test-harness.js"; |
6 | | -import { |
7 | | -PROFILE_ATTACH_RETRY_TIMEOUT_MS, |
8 | | -PROFILE_HTTP_REACHABILITY_TIMEOUT_MS, |
9 | | -} from "./cdp-timeouts.js"; |
| 6 | +import { PROFILE_ATTACH_RETRY_TIMEOUT_MS } from "./cdp-timeouts.js"; |
10 | 7 | import * as chromeModule from "./chrome.js"; |
11 | 8 | import { BrowserProfileUnavailableError } from "./errors.js"; |
12 | 9 | import { createBrowserRouteContext } from "./server-context.js"; |
13 | 10 | import { makeBrowserServerState, mockLaunchedChrome } from "./server-context.test-harness.js"; |
14 | 11 | |
| 12 | +const PROFILE_HTTP_REACHABILITY_TIMEOUT_MS = 300; |
| 13 | + |
15 | 14 | function setupEnsureBrowserAvailableHarness() { |
16 | 15 | vi.useFakeTimers(); |
17 | 16 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。