install_extension / uninstall_extension abandon the operation at 30 s and leave the timer uncleared

Open
#3,607 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@amirkhakshour is already working on this.

Since Nov 24, 2026.

  • #3611 by @amirkhakshour — open
  • #3671 by @qq2514568380 — closed without merging

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
devtools

Research direction

Start in src/McpContext.ts at installExtension and uninstallExtension, and compare them with the timer handling in getDevToolsData around lines 724-741. The reload_extension path in src/tools/extensions.ts goes through installExtension, so check it too. Done means both timers are cleared in a finally and the timeout either cancels the operation or says in the error that it may still complete. Open PR #3611 already targets this, so check it before starting.

Written by the indexing model from the issue text.

Description

confirmed p3
Description of the bug

install_extension and uninstall_extension race the real operation against a 30 s timer, report failure when the timer wins, and leave the operation running. The timer is never cleared on the success path either.

// src/McpContext.ts:1115-1134
async installExtension(extensionPath: string): Promise<string> {
  const id = await Promise.race([
    this.browser.installExtension(extensionPath),
    new Promise<string>((_, rej) =>
      setTimeout(() => rej(new Error('Timeout installing extension')), 30000),
    ),
  ]);
  return id;
}

async uninstallExtension(id: string): Promise<void> {
  await Promise.race([
    this.browser.uninstallExtension(id),
    new Promise<void>((_, rej) =>
      setTimeout(() => rej(new Error('Timeout uninstalling extension')), 30000),
    ),
  ]);
}

Three consequences:

  1. Reported state diverges from actual state. The caller is told the install failed; browser.installExtension keeps running and may succeed. A later list_extensions shows the "failed" extension.
  2. A retry races the abandoned attempt. Nothing cancels the first call, so two concurrent installs of the same path are possible.
  3. The timer outlives the call. On success the 30 s setTimeout is still pending — it fires into a Promise.race that already settled, so it is silently swallowed, but the timer and its closure stay alive for 30 s per call. getDevToolsData in the same file shows the intended shape (src/McpContext.ts:724-741): keep the id and clearTimeout in a finally.

reload_extension inherits the same behaviour — it calls context.installExtension directly (src/tools/extensions.ts:92).

Reproduction
  1. install_extension with a large unpacked extension directory on a slow disk (or a cold network filesystem) so the browser call takes longer than 30 s:
install_extension { "path": "/path/to/large-unpacked-extension" }
# => error: "Timeout installing extension"

list_extensions
# => the extension is listed as installed
  1. reload_extension on the same extension shows the same pattern, because it goes through installExtension.
Expectation

Either the operation is cancelled when the deadline passes (so "failed" is true), or the tool waits for it and reports the real outcome. Reporting failure for work that continues is the one option that leaves the caller unable to reason about state.

Fix shape
  • clearTimeout in a finally and keep both timer handles, mirroring getDevToolsData (src/McpContext.ts:724-741).
  • Decide the semantics for the timeout: propagate an AbortSignal into browser.installExtension/uninstallExtension if Chrome's API allows cancelling, or state in the error that the operation may still complete and the caller should re-check with list_extensions.
Chrome DevTools MCP version

1.13.0 (commit 92250bc)

Notes

Found by an automated multi-lens audit run (mini-ork); three of the four analysis lenses reached this finding independently, and I confirmed it in src/McpContext.ts and src/tools/extensions.ts at 92250bc. Not run here (no Chrome in the audit environment), so the 30 s boundary is read from the constant rather than observed.

Dominant language
TypeScript
Stars
59.8k
Forks
4.8k
Avg merge
2d 10h
Merged PRs (30d)
162

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ChromeDevTools/chrome-devtools-mcp

All issues in ChromeDevTools/chrome-devtools-mcp

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.