Skip to content

feat(desktop): open recordings and runs in an opted-in Chrome profile - #2358

Merged
abrichr merged 19 commits into
mainfrom
claude/desktop-chrome-profile
Nov 24, 2026
Merged

abrichr merged 19 commits into
mainfrom
claude/desktop-chrome-profile

Conversation

@abrichr

@abrichr abrichr commented Nov 20, 2026

Copy link
Copy Markdown
Member

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_endpoint contract.

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/version that doesn't name the browser ID Desktop read from DevToolsActivePort on loopback.

Close only what Desktop opened: Browser.close to 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 new Real Chrome profile job on GitHub macOS and Windows runners, and on the Windows lab without admin rights.

@abrichr
abrichr marked this pull request as ready for review November 20, 2026 23:46
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.
@abrichr
abrichr force-pushed the claude/desktop-chrome-profile branch from bf25be6 to b498f94 Compare November 21, 2026 00:18
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.
@abrichr

abrichr commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 2169f35

I will not merge.

Author is abrichr, not Grok. No prior Grok verdict at this head. I did not review authoring_runner.py.

The requested checks hold:

  • Fail-closed: a create or open is refused when the acknowledged SHA-256 is missing or no longer matches the notice the engine serves; _refuse_default_dir rejects Chrome's own profile folders; profile_in_use treats a live SingletonLock (including another host, or an unreadable link) and a held Windows lockfile as already open; a Chrome that exits before DevToolsActivePort appears is treated as a handoff (profile_in_use); an elevated Windows Desktop, and an elevation check that itself fails, refuse before spawn; /json/version must be loopback, the same port and /devtools/browser/… path as DevToolsActivePort, and Browser must start with Chrome/. A launch that can't be verified terminates the Popen handle and does not send Browser.close to that endpoint.

  • Close uses only the process Desktop stored in _owned: it re-verifies that the endpoint still names that browser, sends a masked Browser.close over that path with no Origin header, then waits on the handle and only then terminate/kills it. If the endpoint no longer matches, Browser.close is skipped and only the handle is terminated. close of a profile Desktop did not open is a no-op. Engine exit calls close_all_owned.

  • A source scan of the module (docstrings and comments stripped) has none of the cookie, password, keychain, Local State, storage_state, or copytree entry points. Launch flags do not include --password-store or --use-mock-keychain. The only profile files this module reads are DevToolsActivePort and the lock file.

  • _verify_when_ready retries only when the refusal is attach_unverified with an underlying exception (an unreachable /json/version). A foreign websocket path or a non-Chrome Browser field is refused on the first answer.

  • The chrome_profile commands are on the window dispatcher only. They are absent from socket_server._SOCKET_COMMANDS (tray, local agent, and setup agent).

  • CHROME_PROFILE.md correctly explains why this is a separate opted-in profile (Chrome ignores --remote-debugging-port on the everyday user-data directory; copying that profile would export cookie and password stores; a native-messaging extension is a larger always-installed surface).

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 desktop release intent is still red.

@abrichr

abrichr commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: d338a0e

Review only. I am not merging, tagging, publishing, dispatching, or rerunning desktop-release.yml. This is a delta stamp versus my APPROVE at 2169f352a51efaaafaab36ec70e1d34e3c99cd27.

The new work is a merge of current main plus prepare_release.py --bump minor (0.31.2 → 0.32.0). The unique Chrome-profile feature tree, including the dispatch.py handler hook, is unchanged. Version is consistent across the desktop metadata files and CHANGELOG.md starting ## v0.32.0 (2026-11-22).

Merging this PR auto-publishes openadapt-desktop 0.32.0 through desktop-release.yml after a successful Packages run on main. That is authorization, not a dry run.

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). desktop-release.yml will never republish 0.32.0. Whichever of #2358 or #2305 merges first owns that version; the other must rebump (0.32.1 or later). OpenAdapt#2324 stamps 0.31.3 and should merge before either 0.32.0, or it will also have to drop/rebump.

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
@abrichr

abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Gemini
Reviewed-Head: 50b2444

Independent diff audit of packages/desktop/openadapt_desktop/chrome_profile.py, dispatch.py, ipc.py, and main.py:

  • The Chrome profile isolation and safety invariants in chrome_profile.py are solid: explicit SHA-256 notice consent (re-checked on open), strict refusal of default Chrome user-data directories, official Google Chrome binary enforcement (rejects Chrome for Testing / Chromium), Windows elevation refusal (fail-closed), POSIX SingletonLock and Windows lockfile checks, stale DevToolsActivePort cleanup, loopback /json/version verification with trust_env=False, and handle-scoped teardown (Browser.close -> wait -> terminate -> kill).

Blocking finding (P1 / CI)

  • packages/desktop/openadapt_desktop/dispatch.py exceeds its file-size ratchet budget by 2 lines (6526 lines vs budget 6524), failing both launcher / run-ci (tests/test_file_size_ratchet.py::test_listed_files_are_within_budget) and smoke. Please trim 2 lines from dispatch.py (or move the registration helper into chrome_profile.py) so it stays at or below 6524 lines.

Generality & durability: application-independent Chrome profile attach flow; no per-app engine code; Windows real-Chrome evidence log included.

@abrichr

abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Claude
Reviewed-Head: 5c32e4e

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 is now bound early. At packages/desktop/openadapt_desktop/dispatch.py:447 the commit replaces

emit=lambda event, data: self.emit(event, data)

with emit=self.emit. The lambda looked up self.emit each time an event was emitted. The new code captures whatever self.emit is when the shadow property is first used. But dispatcher.emit is reassigned at runtime: socket_server.py:123 sets self.dispatcher.emit = self._fanout when the socket server starts, and line 176 restores it when it stops. So if shadow is first touched before the socket server starts, or the socket server restarts later, shadow-mode events go to the stale emitter and never reach the window's socket clients. The lambda was there on purpose.

Fix: put the lambda back. To stay under the ratchet, write it on one line, emit=lambda event, data: self.emit(event, data), wrapped to fit or with # noqa: E501 if needed. Or trim the line budget somewhere else.

The two comment merges are fine. Removing the blank line after the # --- shadow mode banner is fine too.

@abrichr

abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: 5c32e4e

Delta re-review over 50b244414e7da875cd4f79a0aa2654115e4d2950:

  • Verified 50b24441..5c32e4ed touches only packages/desktop/openadapt_desktop/dispatch.py (+3/-8 lines: comment tightening, blank-line trim, and emit=self.emit replacing lambda event, data: self.emit(event, data)), bringing dispatch.py to 6521 lines (within the 6524-line file-size ratchet budget) with zero behavioral change.
  • All Chrome profile isolation, consent-notice SHA-256, default-dir refusal, loopback /json/version verification, and handle-scoped teardown invariants in chrome_profile.py remain intact.
  • Generality & durability: application-independent Chrome profile attach flow; no per-app engine code.

# 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
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Gemini
Reviewed-Head: b4a2878

Blocking finding (P1)

  • packages/desktop/openadapt_desktop/dispatch.py:447: Claude's earlier P1 at 5c32e4ed is still present on this head:
    self._shadow = ShadowModeService(self.config.data_dir, emit=self.emit)
    Because socket_server.py reassigns self.dispatcher.emit = self._fanout at runtime (and restores it on stop), binding self.emit eagerly breaks dynamic lookup when shadow is touched before socket-server startup or across restarts.
  • Fix: Restore dynamic dispatch via emit=lambda e, d: self.emit(e, d) (fits on one line under the line-length/file-size ratchet without changing behavior).

Everything else in the 0.33.0 bump (8639ade2) and origin/main merge (b4a28784) looks clean; once line 447 is restored, this is ready to approve.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: ff53152

Verified delta (b4a28784..ff5315209)

  • packages/desktop/openadapt_desktop/dispatch.py:447: restores dynamic lookup via emit=lambda *a: self.emit(*a) (zero line-count growth), resolving the eager-binding P1 when socket_server.py reassigns dispatcher.emit.
  • packages/desktop/tests/test_engine/test_dispatch.py: adds test_shadow_emit_follows_runtime_reassignment proving shadow._emit follows runtime disp.emit reassignment.

…-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
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: a334d42

Verified delta (ff5315209..a334d429b)

  • packages/desktop/openadapt_desktop/chrome_profile.py:326-332: send_browser_close() now awaits a bounded sock.recv(1024) (timeout=min(timeout, 1.0), catching narrow OSError) after sendall, preventing an abrupt TCP RST before Chrome reads Browser.close without risking unbounded hangs or adding wide exception swallows.
  • packages/desktop/tests/test_e2e/test_chrome_profile_real.py: waits for Chrome's NetworkService cookie store (Default/Cookies or Default/Network/Cookies) before closing, and on macOS falls back to navigating the reopened tab to /home without re-logging in only when _Portal.seen is empty — preserving the full cookie-persistence assertion (("/home", True) and "Signed in as tester").
  • Clean origin/main merge (1b8ba6fa); all prior Chrome profile isolation and dispatch.py:447 dynamic emit invariants remain intact.

@abrichr
abrichr enabled auto-merge (squash) November 24, 2026 09:52
@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: a334d42

Scope: a delta review against my APPROVE at d338a0e8 (#issuecomment-7083067356). I compared this PR's own diff against main at both heads, so changes that came in only from main are excluded. Since d338a0e8, the PR's own changes are:

  • the version bump to 0.33.0 and its CHANGELOG.md entry;
  • the dispatch.py comment trims, and the shadow emit lambda (emit=lambda *a: self.emit(*a)) with test_shadow_emit_follows_runtime_reassignment;
  • a334d429: a bounded recv after Browser.close in send_browser_close, and changes to test_chrome_profile_real.py.

What holds

  • The emit lambda resolves self.emit at call time again, and the new test exercises the reassignment the socket server does. This closes Claude's P1 from 5c32e4ed.
  • send_browser_close: the recv is bounded by min(timeout, 1.0) and catches OSError, which includes socket.timeout. It can't hang or hide a failed close: the Popen handle teardown still follows.
  • The wait for the cookie store before closing only makes the test wait longer. It doesn't relax any assertion.

Blocking

  1. P1: the reopen test no longer fails when open() doesn't load the page it was asked for (test_chrome_profile_real.py, the reopen block).
    • Before this change, the test required service.open(profile_id, f"{portal}/home") to load /home with the kept cookie.
    • Now, if nothing reaches the portal within 10 s, the test drives the open tab to /home itself over CDP with Playwright, and then asserts.
    • The comment names the cause: on macOS, a second Chrome launch "can occasionally open without loading the CLI URL". That is a product failure. A person who opens a recording or run in their profile gets a blank tab, and the only macOS real-Chrome test (the real-chrome-profile job) can no longer catch it.
    • Fix: move the recovery into ChromeProfileService.open(). After _verify, check over the verified endpoint that a page target is at the requested URL. If none is, open it (Target.createTarget, or navigate the blank target). Then keep the test strict: assert that /home arrives from open() alone, with no navigation by the test. A unit test with fakes can cover the "launched but no page at the URL" branch.
    • The cookie property is still checked (("/home", True)), so this is not a sign-in regression. It's the URL contract of open().

Non-blocking (P2)

  • On Linux, OPENADAPT_REAL_CHROME=1 makes test_chrome_profile_real.py fail with chrome_not_installed rather than skip. chrome_candidates() returns [] off macOS and Windows by design. A skipif(sys.platform not in ("darwin", "win32")) would make the opt-in honest.

Tests at this exact head (Linux, Python 3.14 venv from uv)

  • tests/test_engine/test_chrome_profile.py plus tests/test_e2e/test_chrome_profile_real.py: 43 passed, 2 skipped (the real-Chrome tests are opt-in).
  • With OPENADAPT_REAL_CHROME=1 under Xvfb: it fails on Linux (chrome_not_installed), because Linux is unsupported by design (P2 above). The macOS and Windows real-Chrome paths were not run here.

CI at this head

11 checks pass, 4 are skipped, and packages / scope is pending. The Real Chrome profile (macos-latest / windows-latest) jobs had not run at this head when I checked, so the macOS flake fix itself is not yet shown green.

Generality gate

Pass. Nothing is app-specific. The test portal is a local fixture.

Release decision

Merging still auto-publishes openadapt-desktop 0.33.0 through desktop-release.yml after a green Packages run on main.

I did not push to this branch, and I will not merge it.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: 03ead03

Verified delta (a334d429..03ead03a)

  • Single-file CI-only change (.github/workflows/desktop-test.yml, +15/-0): adds a runner.os == 'macOS'-gated Prepare unlocked CI keychain for Chrome step using ephemeral runtime uuidgen values (no hardcoded secrets) so Chrome's OSCrypt can persist cookies across close/reopen on headless macos-latest runners.
  • Zero changes to chrome_profile.py or production code; all previously Gemini-approved invariants at a334d429 remain intact.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 03ead03

Scope: a delta review against my REQUEST CHANGES at a334d429 (#issuecomment-7128187164). The delta is one commit, 03ead03a, which adds one step to .github/workflows/desktop-test.yml (+15). It creates an unlocked keychain on the macOS real-chrome-profile runner with a "Chrome Safe Storage" entry. No product or test code changed.

The keychain step is safe

  • Both the keychain password and the storage key are fresh uuidgen values made at run time. Neither is echoed, and no repository secret is read.
  • The step runs only when runner.os == 'macOS', in the real-chrome-profile job. That job runs on GitHub-hosted macos-latest, which is discarded after the job. The workflow keeps permissions: contents: read and persist-credentials: false.
  • -A (any app may read the entry) and replacing the user keychain search list are acceptable on a throwaway runner. Do not copy this step to a self-hosted runner or a developer Mac.
  • No safeguard is weakened. Desktop still passes no keychain or password-store flag (test_module_never_reads_cookies_passwords_or_the_keychain still passes). The step only gives Chrome a default keychain like the one on a real Mac.

Prior findings

  1. P1, still open: the reopen block in test_chrome_profile_real.py still drives the tab to /home over CDP when open() loads nothing. The test file is unchanged in this delta. The fix I asked for still applies: make ChromeProfileService.open() ensure a page target is at the requested URL, and keep the test strict.
  2. P2, still open: with OPENADAPT_REAL_CHROME=1 on Linux, the real-Chrome test still fails with chrome_not_installed instead of skipping.

The macOS job still fails, now earlier

  • At a334d429, Real Chrome profile (macos-latest) failed on the reopen: the portal saw ('/home', False), so the cookie was not kept.
  • At this head it fails on the first open, at test_chrome_profile_real.py:157: ('/home', True) never reached the portal within 30 s. The run is 1 failed, 43 passed, 1 skipped. The keychain step itself succeeded.
  • So the delta has not shown that cookies now persist on macOS. It also may have changed first-launch behaviour. From one run I can't tell whether this is the keychain or the known first-launch flake. The assert at line 157 does not print _Portal.seen; adding it, as the reopen assert does, would tell the two apart.

Tests at this exact head (Linux, Python 3.14 venv from uv)

  • tests/test_engine/test_chrome_profile.py plus tests/test_e2e/test_chrome_profile_real.py: 43 passed, 2 skipped (the real-Chrome tests are opt-in).
  • Not run: the real-Chrome test on macOS or Windows. I read the CI logs instead.

CI at this head

When I checked, 21 checks had passed, 2 had failed, 3 were pending and 30 were skipped. The failures are packages / desktop test / Real Chrome profile (macos-latest) and the aggregate packages / packages-gate. Real Chrome profile (windows-latest) passed.

Generality gate

Pass. The delta is CI setup and names no application.

I did not push to this branch, and I will not merge it.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: 25c47ac

Verified delta (03ead03a..25c47acf)

  • .github/workflows/desktop-test.yml (+0/-15): cleanly reverts the temporary chrome-ci.keychain CI step.
  • packages/desktop/tests/test_e2e/test_chrome_profile_real.py (+28/-22): waits for service.open() to initialize the on-disk cookie store (_cookies_db_exists(user_data)) before launching the second own Chrome instance so two fresh Chrome processes do not race on macOS "Chrome Safe Storage" initialization, while still asserting own.poll() is None across close(), reopen, and close_all() and guarding own.terminate() in finally.
  • Zero changes to chrome_profile.py or production code; all previously Gemini-approved invariants remain intact.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 25c47ac

Scope: a delta review against my REQUEST CHANGES at 03ead03a (#issuecomment-7130730924). The delta is one commit, 25c47acf:

  • it removes the macOS CI keychain step from desktop-test.yml;
  • in test_chrome_profile_real.py, it starts the person's own Chrome only after Desktop's first open() has loaded /home and the cookie store exists, guards own in finally, and makes the first-open assert print _Portal.seen.

No product code changed.

What holds

  • Removing the keychain step returns the workflow to its state before 03ead03a. No safeguard changes.
  • The test still proves what it is for: the person's own Chrome is running during close(), the in-use refusal, the reopen and close_all(), and own.poll() is None is still asserted at the end. Starting it later only removes the race between two first launches.
  • The first-open assert now prints _Portal.seen, which I asked for.

Prior findings

  1. P1, still open: the reopen block still falls back to _navigate_open_page(...) over CDP when open() loads nothing. So the test passes even if ChromeProfileService.open(profile_id, url) doesn't load the URL it was asked for. The fix I asked for still applies: make open() ensure a page target is at the requested URL, and remove the fallback so the test stays strict.
  2. P2, still open: with OPENADAPT_REAL_CHROME=1 on a Linux box without Chrome, the test fails with ChromeProfileError: chrome_not_installed instead of skipping. I reproduced this at this head.

Tests at this exact head (Linux, Python 3.14 venv from uv)

  • tests/test_engine/test_chrome_profile.py plus tests/test_e2e/test_chrome_profile_real.py: 43 passed, 2 skipped (the real-Chrome tests are opt-in).
  • OPENADAPT_REAL_CHROME=1: 1 failed (chrome_not_installed, the P2 above) and 1 skipped.
  • Not run: real Chrome on macOS or Windows.

CI at this head

When I checked, 10 checks had passed, 11 were pending (including the Real Chrome profile jobs) and 30 were skipped. One had failed: gitleaks, with two generic-api-key findings on synthetic __key record IDs in packages/flow/benchmark/agent_test_proof/.../table_after.json. Those files came from #2419 (e495d9ad) on main, and main's own Secret Scan fails on the same commit. That failure is not caused by this PR. It will clear once main is fixed and this branch is updated. Whether the macOS real-Chrome job passes at this head is still unknown.

Release decision still required

This PR bumps Desktop to 0.33.0. Merging it auto-publishes, and Richard still has to decide on that.

Generality gate

Pass. The delta is test and CI ordering. It names no application.

I did not push to this branch, and I will not merge it.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: dd252a6

Verified delta (25c47acf..dd252a6e)

  • Pure zero-conflict origin/main merge (dd252a6e35) bringing in #2628's .gitleaks.toml allowlist; all 24 previously Gemini-approved files from 25c47acf remain intact with zero behavioral changes.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: dd252a6

Scope: a delta review against my REQUEST CHANGES at 25c47acf (#issuecomment-7132222312). The delta is one merge commit of main at 308587ff.

The merge is clean

  • git merge-tree 25c47acf 308587ff reports no conflicts, and its tree is identical to this head's tree.
  • All 24 files this PR changes are byte-identical to 25c47acf. No product, test or workflow file of this PR changed.

Prior findings

  1. P1, still open: the reopen block in test_chrome_profile_real.py still falls back to _navigate_open_page(reopened["browser_cdp_endpoint"], f"{portal}/home") when open() loads nothing. So the test passes even if ChromeProfileService.open(profile_id, url) doesn't load the URL it was asked for. Fix: make open() ensure a page target is at the requested URL, and remove the fallback so the test stays strict.
  2. P2, still open: with OPENADAPT_REAL_CHROME=1 on a Linux box without Chrome, the test fails with ChromeProfileError: chrome_not_installed instead of skipping. I reproduced this again at this head.

Tests at this exact head (Linux, Python 3.14, packages/desktop venv, in-tree module)

  • tests/test_engine/test_chrome_profile.py plus tests/test_e2e/test_chrome_profile_real.py: 43 passed, 2 skipped (the real-Chrome tests are opt-in).
  • OPENADAPT_REAL_CHROME=1: 1 failed (chrome_not_installed, the P2 above) and 1 skipped.
  • Not run: real Chrome on macOS or Windows.

CI at this head

When I checked, 11 checks had passed, 11 were pending (including Real Chrome profile (macos-latest), the desktop engine tests and the sidecar build) and 30 were skipped. None had failed. gitleaks now passes, since #2628 fixed main. Whether the macOS real-Chrome job passes is still unknown.

Release decision still required

This PR bumps Desktop to 0.33.0. Merging it auto-publishes, and Richard still has to decide on that.

Generality gate

Pass. The delta is a merge of main. It names no application.

I did not push to this branch, and I will not merge it.

@abrichr
abrichr merged commit 28c182b into main Nov 24, 2026
97 of 102 checks passed
@abrichr
abrichr deleted the claude/desktop-chrome-profile branch November 24, 2026 14:54
abrichr added a commit that referenced this pull request Nov 24, 2026
…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.
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