-
Notifications
You must be signed in to change notification settings - Fork 377
--browser-attach-running fails on Chrome 151: discovery needs a DevToolsActivePort file Chrome no longer writes #414
Copy link
Copy link
Open
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Summary
--browser-attach-runningcannot find a browser on Chrome 151, even when the DevTools endpoint is live and answering. Attach discovery looks for aDevToolsActivePortfile in the user data directory, and Chrome 151 does not write one.Every attach run fails with:
The message points at remote debugging, which is already enabled, so it sends you looking in the wrong place.
Environment
Reproduction
Start Chrome with remote debugging and a user data directory under the macOS discovery root:
Confirm the endpoint is up:
curl -s http://127.0.0.1:9222/json/version # {"Browser":"Chrome/151.0.7922.174","Protocol-Version":"1.3", ... }Chrome's own stderr also reports it:
Then run any attach command:
The user data directory contains no
DevToolsActivePortfile:Cause
resolveAttachRunningConnection(src/browser/attachRunning.ts) callsdiscoverDevToolsActivePortCandidates(src/browser/detect.ts:223), which walks the roots fromresolveDevToolsActivePortDiscoveryRoots(src/browser/detect.ts:143,~/Library/Application Supporton macOS) looking forDevToolsActivePortfiles.Discovery is therefore file-based. It never contacts the endpoint the user asked for. When Chrome does not write that file,
candidatesis empty andattachRunning.ts:36throws, regardless of whether127.0.0.1:9222is serving.Workaround
Writing the file by hand makes attach work immediately:
After that the same command connects and completes normally, including attachment upload and submission.
Suggested direction
Two options, both small:
http://host:port/json/versionfirst and usewebSocketDebuggerUrlfrom the response. Fall back to file discovery only when that fails. This removes the dependency on a Chrome implementation detail for the case where the user already told you where the browser is.<root>; the endpoint at 127.0.0.1:9222 was not probed". The current message sends people tochrome://inspect, which does not help.Option 1 also fixes the case where the profile lives outside the platform discovery root, which is easy to hit with a throwaway profile in
/tmp.I am happy to send a PR for either if you have a preference.