Repository navigation
fix(launch): a profile open in the user's own Chrome is exit 11, not UnexpectedError (#984) - #1058
Conversation
…UnexpectedError (#984) Chrome refuses the launch with 'profile is already in use by another instance'; it matched no #293 marker and escaped as error_unhandled. The new browser_manager.profile_in_use_error raises ProfileLockedError, checked after the read-only (ProfileAccessError) check, which shares that header. Closes #984
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Council review: YELLOW.
Re-run live with ci-probe held by my own Chrome: still exit 11 ( |
Summary
ci-probewith a plainchrome.exe --user-data-dir=<profile>holding it).gflow credits user --jsonexited 1,UnexpectedError. The launch error is a generic PlaywrightError: "Opening in existing browser session. This usually means that the profile is already in use by another instance of Chromium." That matches none of_TARGET_CLOSED_MARKERS, so Error-path browser teardown leaves Chrome holding the profile dir (TargetClosedError on the next run) #293's stale-Chrome classifier never fired.browser_manager.profile_in_use_error(exc, profile_dir)returns aProfileLockedError(exit 11, MCPprofile-locked, not retryable) whose hint says to close that Chrome window or use another--profile.FlowApiClient._launch_persistent_contextcalls it, which covers credits, every generation command and their MCP twins._is_profile_access_denied. My first version put it before, and the existingtest_process_singleton_access_denied_raises_profile_access_errormatrix (10 cases) went red. Fixed, with a dedicated regression test.auth renewis not changed. Its headless launch fails asTargetClosedError, and the feat(credits): add --refresh to renew expired sessions; add gflow auth renew #982 per-profile "Close any Chrome window using this profile" skip already handles that (measured on the same held profile).Closes #984
Test plan
tests/api/test_profile_in_use.py. The helper classifies the measured message, ignores other launch errors, the client raisesProfileLockedError, and a read-only profile staysProfileAccessError./gflow:checkgates: hygiene, links, PII, website mirror, council memory, ruff, format, pyright, offline suite 5406 passed (the first run's 10 failures were the ordering regression above).ci-probeheld by my own Chrome (PID recorded, stopped by PID afterwards; no process left on the profile):credits user --json→ exit 11 (was exit 1).gflow_get_credits→profile-lockedenvelope,retryable: false.auth renew→ the existing feat(credits): add --refresh to renew expired sessions; add gflow auth renew #982 skip message.credits usergives the same result on this branch and on untouched develop (ci-probelands on Flow's/about, an account state, exit 31).Summary by CodeRabbit
profile-locked.