Skip to content

feat: companion drives your real Chrome profile by default#43

Merged
Anton-Horn merged 1 commit into
mainfrom
fix/companion-real-profile
Jun 4, 2026
Merged

feat: companion drives your real Chrome profile by default#43
Anton-Horn merged 1 commit into
mainfrom
fix/companion-real-profile

Conversation

@Anton-Horn
Copy link
Copy Markdown
Contributor

Why

The companion (zero browser connect) launched Chrome with a clean, throwaway profile, so the agent never inherited the user's logins/cookies — defeating the point of running the browser on the user's own machine.

What

  • Default launch now uses launchPersistentContext against the real Chrome user-data dir (OS-standard location), so the agent gets the user's existing sessions.
  • Chrome locks a profile while it's open, so a profile-lock failure is turned into a clear, actionable error (quit Chrome, or use --fresh/--cdp).
  • New flags: --fresh (clean throwaway profile, lets Chrome stay open), --user-data-dir <path>, --profile <name>.
  • stop() now only closes contexts we launched, leaving an attached --cdp browser and its tabs untouched.
  • Help text + startup log updated to reflect the new default.

Testing

  • tsc --noEmit clean; bun build.ts succeeds.
  • Not exercised end-to-end (needs an interactive Chrome window on a real machine).

🤖 Generated with Claude Code

The companion launched Chrome with a clean, throwaway profile, so the
agent never inherited the user's logins/cookies — defeating the point of
running the browser on the user's own machine.

Switch the default launch to launchPersistentContext against the real
Chrome user-data dir (OS-standard location), so the agent gets the user's
existing sessions. Chrome locks a profile while open, so a profile-lock
failure is turned into a clear, actionable error. Add --fresh to opt back
into a clean profile, plus --user-data-dir / --profile overrides.

stop() now only closes contexts we launched, leaving an attached --cdp
browser and its tabs untouched.
@Anton-Horn Anton-Horn merged commit 8ed1cf7 into main Jun 4, 2026
1 check passed
@Anton-Horn Anton-Horn deleted the fix/companion-real-profile branch June 4, 2026 13:40
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