Skip to content

feat: zero onboarding, extension version check, and update notifier#479

Merged
jackwener merged 2 commits intomainfrom
claude/cranky-panini
Mar 26, 2026
Merged

feat: zero onboarding, extension version check, and update notifier#479
jackwener merged 2 commits intomainfrom
claude/cranky-panini

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Summary

  • Zero onboarding: when the daemon is running but the extension is not connected, immediately surface a setup guide instead of waiting 30s for the connect timeout to expire
  • Extension version handshake: extension sends its version on WebSocket connect → daemon stores and exposes via /status → CLI warns on mismatch in both the execution path and opencli doctor
  • npm update notifier: non-blocking background fetch writes to ~/.opencli/update-check.json; update notice appears after command output via process.on('exit') hook (same pattern as npm/gh/yarn)
  • postinstall hint: print Browser Bridge setup instructions after shell completion install for first-time global users

Changes

File Change
extension/src/background.ts Send { type: 'hello', version } on WS connect
src/daemon.ts Store extensionVersion, expose via /status, clear on disconnect/error
src/browser/discover.ts checkDaemonStatus() returns extensionVersion, add AbortController timeout
src/execution.ts Fail-fast guard + version mismatch warning before browser commands
src/doctor.ts Show extension version inline; version mismatch as actionable issue
src/update-check.ts New: non-blocking update checker with exit hook
src/main.ts Wire up registerUpdateNoticeOnExit + checkForUpdateBackground
scripts/postinstall.js Browser Bridge setup hint after install

Test plan

  • opencli bilibili hot with extension installed but disconnected → immediate error with setup guide (not 30s timeout)
  • opencli doctor with mismatched extension/CLI versions → version shown inline, mismatch in Issues
  • npm install -g @jackwener/opencli → Browser Bridge hint printed after completion install
  • Run any command with a newer version in ~/.opencli/update-check.json → update notice appears after output
  • Run opencli --get-completions ... → no update notice in output
  • Run a failing command → no update notice on error exit

- Fail-fast guard in execution.ts: when daemon is running but extension
  is not connected, immediately surface a setup guide instead of waiting
  for the 30s connect timeout

- Extension version handshake: extension sends `hello` with its version
  on WebSocket connect; daemon stores it and exposes via /status; CLI
  warns on mismatch in both execution path and `opencli doctor`

- `opencli doctor` now shows extension version inline and reports
  version mismatch as an actionable issue

- Non-blocking npm update checker: registers a process exit hook so the
  update notice appears after command output (same pattern as npm/gh/yarn);
  background fetch writes to ~/.opencli/update-check.json for next run

- postinstall: print Browser Bridge setup instructions after shell
  completion install for first-time global install users

Bug fixes caught in review:
- discover.ts: add AbortController timeout to checkDaemonStatus() fetch,
  move clearTimeout after res.json() to cover body streaming
- daemon.ts: clear extensionVersion and reject pending requests in
  ws.on('error') handler, not just ws.on('close')
- update-check.ts: skip update notice when process exits with non-zero
  code; read cache once at module load to avoid double disk I/O;
  guard isNewer() against NaN from pre-release version strings
@jackwener jackwener force-pushed the claude/cranky-panini branch from 03e83ab to 38a3cd3 Compare March 26, 2026 18:09
@jackwener jackwener merged commit 7617dff into main Mar 26, 2026
22 checks passed
@jackwener jackwener mentioned this pull request Mar 26, 2026
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