browse: $B connect fails with compiled binary — auto-starts headless before connect intercept
- Dominant language
- TypeScript
- Stars
- 133k
- Forks
- 19.9k
- Avg merge
- 18h 46m
- Merged PRs (30d)
- 26
Description
## What I was trying to do
Run `$B connect` to launch headed Chrome with the extension, per the /connect-chrome skill.
## What happened instead
```
$ $B connect
[browse] Starting server...
The connect command must be run from the CLI (not sent to a running server). Run: $B connect
```
The compiled binary auto-starts a headless server as part of CLI startup. By the time the `connect` handler at cli.ts:487 runs, a server is already alive and the handler sees a "running server" and rejects.
## Steps to reproduce
1. Ensure no browse server is running: `pkill -f browse; rm -f .gstack/browse.json`
2. Run: `$B connect` (using the compiled binary from `browse/dist/browse`)
3. Observe the error message
## Expected behavior
`connect` should intercept before `ensureServer()` fires and start the server in headed mode with the extension.
## Analysis
In `cli.ts:485-526`, the `connect` case is supposed to fire before `ensureServer()`. But the compiled binary's startup sequence appears to call `ensureServer()` first, creating a headless server before `connect` can intercept.
This may only affect the compiled binary — running via `bun run browse/src/cli.ts connect` might work correctly.
## Environment
- macOS 14.x (arm64)
- bun 1.3.11
- gstack v0.12.2.0 (commit 4f435e4)
Contributor guide
Assessment
This issue has not been assessed yet.