Repository navigation
feat(desktop): open recordings and runs in an opted-in Chrome profile - #2358
Conversation
Desktop can open the installed Google Chrome on a separate, Desktop-managed profile after the person agrees to an engine-served notice. They sign in once (SSO or two-factor as usual) and Chrome keeps the sign-ins; recordings and runs attach through the existing browser_cdp_endpoint contract. Fail closed on a changed notice, a default Chrome folder, a profile already open elsewhere, a Chrome that hands off and exits, or an endpoint that doesn't name the process Desktop started. Close only that process (Browser.close, then the handle). No cookie, password or keychain access.
Chrome restarts itself without admin rights when started elevated, so the handle Desktop holds exits and the window can't be verified or closed by it. Refuse before launch. Never probe a pid with os.kill on Windows. Adds the Windows lab run and the CAPABILITIES row.
Spawn through child_process.popen (no new session, which would fork the engine). Move the Chrome profile handlers into chrome_profile.py; dispatch.py gains two lines, and its budget row rises by those two.
bf25be6 to
b498f94
Compare
On a cold macOS runner /json/version timed out right after Chrome wrote DevToolsActivePort. Retry an unreachable server until the start timeout; an endpoint that answers for another browser is still refused at once.
Independent adversarial review: APPROVEFrom: Grok I will not merge. Author is abrichr, not Grok. No prior Grok verdict at this head. I did not review The requested checks hold:
Tests cover those refusals, the retry rule, close ownership, the window-only allowlist, and the elevated-Windows path. I will not merge. This head is MERGEABLE/BLOCKED; the author asked to wait for a Desktop version bump, and |
Independent adversarial review: APPROVEFrom: Grok Review only. I am not merging, tagging, publishing, dispatching, or rerunning The new work is a merge of current Merging this PR auto-publishes Merge-order note (not a blocker of this PR's own tree): OpenAdapt#2305 also stamps desktop 0.32.0, with a different unique tree (shared theme roles). I approve this head. I am not merging it. |
# Conflicts: # packages/desktop/CHANGELOG.md # packages/desktop/openadapt_desktop/__init__.py # packages/desktop/package-lock.json # packages/desktop/package.json # packages/desktop/pyproject.toml # packages/desktop/src-tauri/Cargo.lock # packages/desktop/src-tauri/Cargo.toml # packages/desktop/src-tauri/tauri.conf.json # packages/desktop/uv.lock
Independent adversarial review: REQUEST CHANGESFrom: Gemini Independent diff audit of
Blocking finding (P1 / CI)
Generality & durability: application-independent Chrome profile attach flow; no per-app engine code; Windows real-Chrome evidence log included. |
Independent adversarial review: REQUEST CHANGESFrom: Claude This review covers only Gemini's commit 5c32e4e, "trim 5 redundant lines in dispatch.py". That commit is not a zero-behaviour change. P1. The shadow-mode emit=lambda event, data: self.emit(event, data)with Fix: put the lambda back. To stay under the ratchet, write it on one line, The two comment merges are fine. Removing the blank line after the |
Independent adversarial review: APPROVEFrom: Gemini Delta re-review over
|
# Conflicts: # packages/desktop/CHANGELOG.md # packages/desktop/openadapt_desktop/__init__.py # packages/desktop/package-lock.json # packages/desktop/package.json # packages/desktop/pyproject.toml # packages/desktop/src-tauri/Cargo.lock # packages/desktop/src-tauri/Cargo.toml # packages/desktop/src-tauri/tauri.conf.json # packages/desktop/uv.lock
Independent adversarial review: REQUEST CHANGESFrom: Gemini Blocking finding (P1)
Everything else in the |
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
…-profile # Conflicts: # packages/desktop/CHANGELOG.md # packages/desktop/openadapt_desktop/__init__.py # packages/desktop/package-lock.json # packages/desktop/package.json # packages/desktop/pyproject.toml # packages/desktop/src-tauri/Cargo.lock # packages/desktop/src-tauri/Cargo.toml # packages/desktop/src-tauri/tauri.conf.json # packages/desktop/uv.lock
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my APPROVE at
What holds
Blocking
Non-blocking (P2)
Tests at this exact head (Linux, Python 3.14 venv from
|
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at The keychain step is safe
Prior findings
The macOS job still fails, now earlier
Tests at this exact head (Linux, Python 3.14 venv from
|
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at
No product code changed. What holds
Prior findings
Tests at this exact head (Linux, Python 3.14 venv from
|
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at The merge is clean
Prior findings
Tests at this exact head (Linux, Python 3.14,
|
…test without Chrome (#2636) * fix(desktop): open() lands on the requested URL; skip real-Chrome test without Chrome (fix-forward #2358) ChromeProfileService.open(profile_id, url) now makes a page target land on the URL itself: it waits briefly for the launch tab, otherwise opens a tab at the URL over PUT /json/new, and requires /json/list to report it on an http(s) page. A page that never lands refuses with page_not_loaded; a window Desktop just started is closed again, an already-open one is kept. The same check runs when an already-open profile is opened with a URL. The real-Chrome test no longer navigates the tab itself when open() loads nothing, so it asserts what open() did, and it skips when Google Chrome isn't installed instead of failing with chrome_not_installed. * fix(desktop): confirm the page loaded over CDP and count only the launch tab by origin open(profile_id, url) now asks each candidate tab, over its own debugging socket, for location.href and document.readyState, and requires an http(s) document that isn't Chrome's error page, interactive or complete. Chrome keeps the requested address on a target that shows its error page, so the target URL alone never caught an address that doesn't load. An error page refuses at once with page_not_loaded. Only the launch tab (the single page on the first listing of a window Desktop just started) may count by origin. A restored or other tab on the same origin no longer stands in for the requested URL.
Desktop can open the installed Google Chrome on a separate, Desktop-managed profile after the person agrees to an engine-served notice (SHA-256 acknowledged, re-asked when it changes, revocable with delete). The person signs in once (SSO or two-factor as usual); Chrome keeps the sign-ins, and recordings and runs attach through the existing
browser_cdp_endpointcontract.Mechanism and why: see
packages/desktop/docs/CHROME_PROFILE.md. Chrome ignores remote debugging on its default profile; copying a profile exports its cookie and password stores (and needs the macOS keychain); an extension plus native messaging adds a per-OS host and store or policy install for no extra reach.Fail closed (codes in the doc): changed or missing consent, Chrome's own profile folders, a profile already open (
SingletonLock/lockfile), a Chrome that hands off and exits, an elevated Windows Desktop (Chrome restarts itself de-elevated, so the handle is lost), or a/json/versionthat doesn't name the browser ID Desktop read fromDevToolsActivePorton loopback.Close only what Desktop opened:
Browser.closeto that process's verified endpoint, then the Popen handle; never by name. Engine exit closes owned windows.Never: cookie or password reads, keychain calls or keychain flags (static test). Only official Google Chrome; Chrome for Testing and Chromium are refused. Commands are window-only (not on the tray or agent socket; tested). Does not touch
authoring_runner.py(#2259 owns it; that path stays empty-cookie).Tests: fakes-only unit tests (
test_chrome_profile.py), vitest for the picker, and a real-Chrome test (test_chrome_profile_real.py,OPENADAPT_REAL_CHROME=1) in a newReal Chrome profilejob on GitHub macOS and Windows runners, and on the Windows lab without admin rights.