Commit Graph

3 Commits

Author SHA1 Message Date
ShawnPana e34ee5898e fix(tests): remove unused imports and fix formatting
Pre-commit hooks auto-fixed:
- test_doctor_command.py: Remove unused browser_use import
- test_install_config.py: Remove unused tempfile import, fix formatting
- test_session_browser_mode.py: Remove unused imports (patch, pytest), fix formatting
- test_setup_command.py: Remove unused pytest import

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 15:48:26 -08:00
ShawnPana 9f51461bbd fix(cli): error when requesting remote browser on local session + improve docs
When a session is started without --browser remote and a subsequent command
uses --browser remote, the CLI now errors with guidance instead of silently
using the local browser (which loses cloud features like live_url).

Code changes:
- Add session metadata file to track browser_mode per session
- Error only when remote requested but session is local
- Allow local-on-remote (user gets more features than requested)
- Clean up metadata on session close

SKILL.md improvements:
- Clarify that --browser remote only needed on FIRST command
- Add table showing session modes
- Add "What happens if you forget" section with error example
- Add troubleshooting entry for mode mismatch error

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 18:20:06 -08:00
ShawnPana 3c9b2501ac fix(cli): detect browser mode mismatch between existing session and requested mode
When a session is started with --browser chromium and a subsequent command
uses --browser remote (or vice versa), the CLI now detects the mismatch and
provides actionable error guidance instead of silently using the wrong mode.

Changes:
- Add get_session_metadata_path() to track session config in temp files
- Write browser_mode, headed, profile to metadata on server start
- Check metadata in ensure_server() and error if modes don't match
- Clean up metadata file on session close

Example error:
  Error: Session 'default' is running with --browser chromium,
  but --browser remote was requested.

  Options:
    1. Use existing browser: browser-use --browser chromium <command>
    2. Use different session: browser-use --browser remote --session other <command>
    3. Close existing session: browser-use close

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 18:10:46 -08:00