Skip to content

Commit d581415

Browse files
rohitjavvadiclawsweeper[bot]Takhoffman
authored
Disable Chrome MCP telemetry watchdog by default (#85886)
Summary: - The PR adds the Chrome DevTools MCP `--no-usage-statistics` default launch arg, honors explicit profile usage-statistics `mcpArgs`, adds regression tests, and adds a changelog entry. - Reproducibility: yes. source-reproducible: current main builds Chrome MCP launch args without the upstream o ... etry is initialized. I did not run a fresh failing current-main process leak loop in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: Disable Chrome MCP telemetry watchdog by default Validation: - ClawSweeper review passed for head 68249b1. - Required merge gates passed before the squash merge. Prepared head SHA: 68249b1 Review: #85886 (comment) Co-authored-by: Rohit <[email protected]> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <[email protected]>
1 parent 12f8227 commit d581415

3 files changed

Lines changed: 46 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Docs: https://docs.openclaw.ai
6767
- WebChat: keep the run-complete indicator in progress until deferred history replay renders the assistant reply, so Done no longer appears before response text. (#85374) Thanks @neeravmakwana.
6868
- Agents/compaction: skip agent-harness preflight for provider-owned CLI runtime sessions so over-threshold Claude CLI sessions continue through normal compaction instead of failing on a missing harness. Fixes #84857. (#84878) Thanks @zhangguiping-xydt.
6969
- Control UI/config: save form-mode edits from the source config snapshot so runtime-only provider defaults like empty `models.providers.<id>.baseUrl` are not written back and rejected. Fixes #85831. Thanks @garyd9.
70+
- Browser/existing-session: launch Chrome DevTools MCP with usage statistics disabled by default so its telemetry watchdog stays off unless an operator explicitly opts in. (#85886) Thanks @rohitjavvadi.
7071
- Telegram: normalize legacy durable group retry targets before retry sends, polls, and pins so group retries keep using the real chat id. (#85656) Thanks @luoyanglang.
7172
- Agents/PDF: route MiniMax PDF fallback policy through plugin metadata so MiniMax uses text extraction instead of VLM image fallback. (#85590, fixes #85575) Thanks @neeravmakwana.
7273
- WebChat: summarize internal message-tool source replies so tool cards no longer duplicate the visible reply body. (#84773) Thanks @jason-allen-oneal.

extensions/browser/src/browser/chrome-mcp.test.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ describe("chrome MCP page parsing", () => {
164164
"-y",
165165
"chrome-devtools-mcp@latest",
166166
"--autoConnect",
167+
"--no-usage-statistics",
167168
"--experimentalStructuredContent",
168169
"--experimental-page-id-routing",
169170
"--userDataDir",
@@ -182,6 +183,7 @@ describe("chrome MCP page parsing", () => {
182183
"chrome-devtools-mcp@latest",
183184
"--browserUrl",
184185
"http://127.0.0.1:9222",
186+
"--no-usage-statistics",
185187
"--experimentalStructuredContent",
186188
"--experimental-page-id-routing",
187189
]);
@@ -197,6 +199,7 @@ describe("chrome MCP page parsing", () => {
197199
"chrome-devtools-mcp@latest",
198200
"--wsEndpoint",
199201
"ws://127.0.0.1:9222/devtools/browser/abc",
202+
"--no-usage-statistics",
200203
"--experimentalStructuredContent",
201204
"--experimental-page-id-routing",
202205
]);
@@ -219,6 +222,36 @@ describe("chrome MCP page parsing", () => {
219222
]);
220223
});
221224

225+
it("lets explicit Chrome MCP usage-statistics args override the default opt-out", () => {
226+
expect(
227+
buildChromeMcpArgs({
228+
mcpArgs: ["--usage-statistics"],
229+
}),
230+
).toEqual([
231+
"-y",
232+
"chrome-devtools-mcp@latest",
233+
"--autoConnect",
234+
"--experimentalStructuredContent",
235+
"--experimental-page-id-routing",
236+
"--usage-statistics",
237+
]);
238+
});
239+
240+
it("does not duplicate an explicit Chrome MCP usage-statistics opt-out", () => {
241+
expect(
242+
buildChromeMcpArgs({
243+
mcpArgs: ["--no-usage-statistics"],
244+
}),
245+
).toEqual([
246+
"-y",
247+
"chrome-devtools-mcp@latest",
248+
"--autoConnect",
249+
"--experimentalStructuredContent",
250+
"--experimental-page-id-routing",
251+
"--no-usage-statistics",
252+
]);
253+
});
254+
222255
it("omits the npx package prefix for a custom Chrome MCP command", () => {
223256
expect(
224257
buildChromeMcpArgs({
@@ -228,6 +261,7 @@ describe("chrome MCP page parsing", () => {
228261
).toEqual([
229262
"--browserUrl",
230263
"http://127.0.0.1:9222",
264+
"--no-usage-statistics",
231265
"--experimentalStructuredContent",
232266
"--experimental-page-id-routing",
233267
]);
@@ -338,7 +372,9 @@ describe("chrome MCP page parsing", () => {
338372

339373
expect(message).toContain("Chrome MCP existing-session attach failed");
340374
expect(message).toContain("~/Library/Application Support/Google/Chrome/Profile 1");
341-
expect(message).toContain("attach failed for ~/Library/Application Support/Google/Chrome/Profile 1");
375+
expect(message).toContain(
376+
"attach failed for ~/Library/Application Support/Google/Chrome/Profile 1",
377+
);
342378
expect(message).not.toContain(homeDir);
343379
expect(message).not.toContain(userDataDir);
344380
});

extensions/browser/src/browser/chrome-mcp.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ type ChromeMcpSessionFactory = (
7272
const DEFAULT_CHROME_MCP_COMMAND = "npx";
7373
const DEFAULT_CHROME_MCP_PACKAGE_ARGS = ["-y", "chrome-devtools-mcp@latest"];
7474
const DEFAULT_CHROME_MCP_FEATURE_ARGS = [
75+
"--no-usage-statistics",
7576
// Direct chrome-devtools-mcp launches do not enable structuredContent by default.
7677
"--experimentalStructuredContent",
7778
"--experimental-page-id-routing",
7879
];
80+
const CHROME_MCP_USAGE_STATISTICS_FLAG_RE = /^--(?:no-)?usage-?statistics(?:=.*)?$/i;
7981
const CHROME_MCP_CONNECTION_FLAGS = new Set([
8082
"--autoConnect",
8183
"--auto-connect",
@@ -342,10 +344,15 @@ async function closeChromeMcpSessionsForProfile(
342344
function buildChromeMcpArgsFromOptions(options: NormalizedChromeMcpProfileOptions): string[] {
343345
const commandPrefix =
344346
options.command === DEFAULT_CHROME_MCP_COMMAND ? DEFAULT_CHROME_MCP_PACKAGE_ARGS : [];
347+
const defaultFeatureArgs = options.extraArgs.some((arg) =>
348+
CHROME_MCP_USAGE_STATISTICS_FLAG_RE.test(arg),
349+
)
350+
? DEFAULT_CHROME_MCP_FEATURE_ARGS.filter((arg) => arg !== "--no-usage-statistics")
351+
: DEFAULT_CHROME_MCP_FEATURE_ARGS;
345352
return [
346353
...commandPrefix,
347354
...buildChromeMcpConnectionArgs(options),
348-
...DEFAULT_CHROME_MCP_FEATURE_ARGS,
355+
...defaultFeatureArgs,
349356
...buildChromeMcpUserDataDirArgs(options),
350357
...options.extraArgs,
351358
];

0 commit comments

Comments
 (0)