Skip to content

Boot Chrome on demand instead of keeping it always running#19

Merged
huangruoqi merged 3 commits into
mainfrom
browser-restart
Jul 7, 2026
Merged

Boot Chrome on demand instead of keeping it always running#19
huangruoqi merged 3 commits into
mainfrom
browser-restart

Conversation

@huangruoqi

Copy link
Copy Markdown
Collaborator

Summary

  • LinkedIn tool calls in outreach/browser.py now check the CDP endpoint before attaching, and lazily launch Chrome via bin/browser-service start (waiting for CDP) if it's not already up.
  • Uninstalled the always-on launchd KeepAlive service on the local machine — no longer needed since the browser wakes on demand. bin/browser-service install is still there if anyone wants auto-start-at-login back.
  • Login session is unaffected: cookies persist on disk in the Chrome --user-data-dir profile, independent of whether the process is running.

Test plan

  • Stopped Chrome fully (bin/browser-service uninstall, confirmed cdp_running=no)
  • Ran a real LinkedInBrowser(mode="attach") call with no Chrome running — confirmed it launched Chrome, attached, and is_logged_in() returned True

🤖 Generated with Claude Code

huangruoqi and others added 3 commits July 7, 2026 11:37
LinkedIn tool calls now ping the CDP endpoint before attaching and, if
Chrome isn't up, launch it via bin/browser-service start and wait for
CDP to come up. Session cookies persist on disk in the Chrome profile,
so this is safe — no need for launchd/systemd to keep Chrome alive
between calls anymore.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mand

Chrome no longer needs to stay running between calls, so probe_browser
reporting it down is the expected steady state, not an incident — drop
the startup warning log and the stale "reinstall the always-on service"
restart hint from status output.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Update the unit test to match cron/system_status.py's new behavior:
Chrome down no longer logs a warning, and restart_hint was replaced by
starts_on_demand.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@huangruoqi huangruoqi merged commit 88e6376 into main Jul 7, 2026
2 checks passed
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