Skip to content

fix(browser-bridge): point remediation at the local extension checkout when running from source#2181

Open
josephkehan-prog wants to merge 1 commit into
jackwener:mainfrom
josephkehan-prog:fix/browser-bridge-doctor-remediation
Open

fix(browser-bridge): point remediation at the local extension checkout when running from source#2181
josephkehan-prog wants to merge 1 commit into
jackwener:mainfrom
josephkehan-prog:fix/browser-bridge-doctor-remediation

Conversation

@josephkehan-prog

Copy link
Copy Markdown

The problem

When the Browser Bridge extension is not connected, both doctor and the no-extension BrowserConnectError tell the user to download a release zip.

That is correct for a global npm install — package.json's files array ships dist/src/, clis/, skills/, cli-manifest.json, scripts/, README and LICENSE, but not extension/. So an installed copy genuinely has no extension on disk.

It is wrong when running from a source checkout, where extension/manifest.json and a built extension/dist/background.js are already sitting right there. The user gets sent to a download page for files they already have.

The fix

Adds hasLocalExtensionSource(packageRoot) to src/package-paths.ts — checks for extension/manifest.json next to the resolved package root, which is false for a real install per the files list above and true for a checkout — and branches the remediation text on it.

Fixed in both places the stale advice appeared, not just the obvious one:

  • src/doctor.ts
  • src/browser/daemon-lifecycle.ts (the no-extension BrowserConnectError path)

Output from a checkout now:

[MISSING] Extension: not connected
Issues:
  • Daemon is running but the Chrome/Chromium extension is not connected.
If the extension is already installed, try: opencli daemon restart
If the extension is not installed:
  1. Open chrome://extensions/ → Enable Developer Mode
  2. Click "Load unpacked" → select this checkout's extension/ folder (<repo>/extension)

An installed copy keeps the existing download-the-release guidance unchanged.

Test plan

  • npx tsc --noEmit -p . clean.
  • unit: 83 files / 1284 tests pass (1 pre-existing unrelated skip).
  • extension: 3 files / 96 tests pass.
  • adapter: 473 files / 4969 tests pass.
  • src/doctor.test.ts specifically: 18/18. Confirmed no test pins the old exact remediation string, so nothing needed updating there.
  • Verified the live output above from an actual source checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WRqKZ1vQa29kYHJEr4iRGj

doctor and the no-extension BrowserConnectError both told the user to
download a release zip. That is right for a global npm install -- the
`files` array does not ship `extension/` -- but wrong when running from a
source checkout, where extension/manifest.json and the built
extension/dist/background.js are already on disk.

Add hasLocalExtensionSource() and branch both messages on it, so a
checkout gets "Load unpacked -> <path>/extension" instead of being sent
to a download page for files it already has.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRqKZ1vQa29kYHJEr4iRGj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant