fix(browser-bridge): point remediation at the local extension checkout when running from source#2181
Open
josephkehan-prog wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
When the Browser Bridge extension is not connected, both
doctorand theno-extensionBrowserConnectErrortell the user to download a release zip.That is correct for a global npm install —
package.json'sfilesarray shipsdist/src/,clis/,skills/,cli-manifest.json,scripts/, README and LICENSE, but notextension/. So an installed copy genuinely has no extension on disk.It is wrong when running from a source checkout, where
extension/manifest.jsonand a builtextension/dist/background.jsare already sitting right there. The user gets sent to a download page for files they already have.The fix
Adds
hasLocalExtensionSource(packageRoot)tosrc/package-paths.ts— checks forextension/manifest.jsonnext to the resolved package root, which is false for a real install per thefileslist 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.tssrc/browser/daemon-lifecycle.ts(theno-extensionBrowserConnectErrorpath)Output from a checkout now:
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.tsspecifically: 18/18. Confirmed no test pins the old exact remediation string, so nothing needed updating there.🤖 Generated with Claude Code
https://claude.ai/code/session_01WRqKZ1vQa29kYHJEr4iRGj