Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
57e89de
feat(desktop): open recordings and runs in an opted-in Chrome profile
abrichr Nov 20, 2026
e353918
fix(desktop): refuse an elevated Windows launch and record lab evidence
abrichr Nov 20, 2026
74dbd78
test(desktop): keep the Windows lab real-Chrome run log
abrichr Nov 20, 2026
d114c3a
fix(desktop): start Chrome without forking and keep dispatch.py small
abrichr Nov 21, 2026
b498f94
chore(desktop): keep the dispatch.py budget row unchanged
abrichr Nov 21, 2026
2169f35
fix(desktop): wait for a slow Chrome debugging server before refusing
abrichr Nov 21, 2026
7ca5482
Merge remote-tracking branch 'origin/main' into HEAD
abrichr Nov 22, 2026
d338a0e
chore(desktop): prepare openadapt-desktop 0.32.0
abrichr Nov 22, 2026
50b2444
Merge remote-tracking branch 'origin/main' into HEAD
abrichr Nov 23, 2026
5c32e4e
chore(desktop): trim 5 redundant lines in dispatch.py to satisfy file…
abrichr Nov 23, 2026
83b1095
Merge remote-tracking branch 'origin/main' into HEAD
abrichr Nov 24, 2026
8639ade
chore(desktop): bump 0.33.0 release intent for Chrome profile support
abrichr Nov 24, 2026
b4a2878
Merge remote-tracking branch 'origin/main' into HEAD
abrichr Nov 24, 2026
ff53152
fix(desktop): defer shadow emit lookup so runtime dispatcher.emit rea…
abrichr Nov 24, 2026
1b8ba6f
Merge remote-tracking branch 'origin/main' into claude/desktop-chrome…
abrichr Nov 24, 2026
a334d42
fix(desktop): await Browser.close ack and stabilize macOS Chrome prof…
abrichr Nov 24, 2026
03ead03
ci(desktop): prepare unlocked macOS CI keychain for real Chrome cooki…
abrichr Nov 24, 2026
25c47ac
fix(desktop): serialize first Chrome launch before starting own Chrom…
abrichr Nov 24, 2026
dd252a6
Merge remote-tracking branch 'origin/main' into claude/desktop-chrome…
abrichr Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/desktop-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,41 @@ jobs:
- name: Run release-intent tests
run: uv run --no-sync pytest tests/test_release_intent.py -v

real-chrome-profile:
# Desktop-managed Chrome profile against the runner's installed Google
# Chrome: opt-in record, launch on a separate profile, verified attach,
# in-use refusal, sign-in kept across a close and reopen, and Desktop
# closing only the window it opened. Runs on every tier: it is the only
# macOS run of a real Chrome window (never on a developer Mac).
name: Real Chrome profile (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: true
cache-dependency-glob: packages/desktop/uv.lock

- name: Set up Python 3.12
run: uv python install 3.12

- name: Install locked dependencies
run: uv sync --locked --python 3.12 --extra dev --extra build

- name: Run the real Chrome profile test
env:
OPENADAPT_REAL_CHROME: "1"
run: uv run --no-sync pytest tests/test_e2e/test_chrome_profile_real.py tests/test_engine/test_chrome_profile.py -v

qualification-contract:
name: Qualification contract (bundled Flow)
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| Web in a signed-in Chrome profile (Desktop): after the person agrees to a notice, Desktop opens the installed Google Chrome on a separate profile it manages; they sign in once (SSO or two-factor), and recordings and runs attach to that window already signed in. Refuses a changed notice, Chrome's own profile folders, a profile open elsewhere, an elevated Windows Desktop, and an endpoint that doesn't name the process Desktop started; closes only that process; never reads cookies or passwords and never calls the keychain | In [#2358](https://github.com/OpenAdaptAI/OpenAdapt/pull/2358) | Unit tests with fakes; real Google Chrome 158 on a Windows 11 laptop without admin rights against a synthetic sign-in page (sign-in kept across close and reopen, open profile refused, another Chrome window left open); the same test on GitHub-hosted macOS, and the elevated refusal on GitHub-hosted Windows | [CHROME_PROFILE.md](packages/desktop/docs/CHROME_PROFILE.md), `packages/desktop/openadapt_desktop/chrome_profile.py` |
14 changes: 14 additions & 0 deletions packages/desktop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# CHANGELOG


## v0.33.0 (2026-11-23)

### Features

- **desktop**: open recordings and runs in an opted-in Chrome profile

### Bug Fixes

- **desktop**: wait for a slow Chrome debugging server before refusing
- **desktop**: start Chrome without forking and keep dispatch.py small
- **desktop**: refuse an elevated Windows launch and record lab evidence



## v0.32.3 (2026-11-23)

### Bug Fixes
Expand Down
92 changes: 92 additions & 0 deletions packages/desktop/docs/CHROME_PROFILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Chrome profiles for signed-in portals

Some portals sign in with SSO or two-factor authentication, so a fresh browser
starts every recording and run at the sign-in page. OpenAdapt Desktop can open
Google Chrome on a separate profile that Desktop manages. You sign in there
once, and Chrome keeps those sign-ins. Later recordings and runs attach to that
window and start already signed in.

This isn't your everyday Chrome profile. The first time, the new profile is
empty and you sign in to each site in it.

## How to use it

1. In a Browser target, select **Use a Chrome profile**.
2. Read the notice, name the profile, select **I've read this and agree**, and
select **Agree**.
3. Select **Open in Chrome**. Desktop opens Google Chrome on the profile at the
page address you entered and fills **Signed-in browser** with that window's
local address.
4. Sign in to the site in that window, then record or run as usual.
5. Select **Close Chrome window** when you're done. **Delete profile** turns
the profile off and deletes its folder, including its sign-ins.

## What Desktop does and doesn't do

- Desktop creates the profile folder under its own data folder
(`chrome-profiles/<id>/user-data`), readable only by your user account. It
refuses Chrome's own profile folders.
- Desktop starts only the official Google Chrome build, from its usual install
location. It refuses Chrome for Testing and Chromium builds.
- Desktop starts Chrome with `--user-data-dir` set to that folder and
`--remote-debugging-port=0`, so Chrome picks a free local port. It passes no
keychain or password-store flag, so Chrome stores the profile's data the way
it always does.
- Desktop never reads, copies or exports the profile's cookies or saved
passwords, and it never calls the macOS keychain. The only files it reads in
the profile are Chrome's `DevToolsActivePort` and its lock file.
- Desktop closes only the Chrome process it started, through the process handle
it holds. It sends `Browser.close` to that process's own debugging address,
and ends the process only if that fails. It never closes Chrome by name.

## When Desktop refuses

Desktop refuses before anything is attached, and closes a window it started
that it can't verify, in these cases:

| Code | When |
| --- | --- |
| `consent_required` | You haven't agreed to the notice, or the notice changed since you agreed. |
| `profile_in_use` | The profile is already open in a Chrome window Desktop didn't open (`SingletonLock` on macOS, `lockfile` on Windows), or Chrome passed the window to a Chrome that was already running and exited. |
| `attach_unverified` | Chrome didn't report a debugging address, or `/json/version` on that address doesn't name the browser Desktop started (another port, another browser ID, not loopback, or not Google Chrome). |
| `default_profile_refused` | The folder is one of Chrome's own profile folders. |
| `chrome_not_installed` | Google Chrome isn't in its usual install location. |

## Why this mechanism

Three options were considered.

- **Attach to the everyday profile.** Chrome ignores
`--remote-debugging-port` when it runs on its default profile folder, so this
isn't supported, and it would expose every site you're signed in to.
- **Copy the everyday profile.** A copy duplicates Chrome's cookie and password
stores, which is an export of both. On macOS, using the copy also needs the
keychain entry Chrome encrypts them with. Desktop does neither.
- **A Chrome extension with native messaging.** It needs a store listing or an
enterprise policy, a native host registered for each browser and operating
system, and its own consent path. It's an always-installed component that
reaches no more than a separate profile does.

A separate, Desktop-managed profile on the installed Chrome works the same way
on Windows and macOS, reaches only the sites you signed in to there, and keeps
every credential inside Chrome.

## The debugging port

While the profile is open, Chrome accepts local debugging connections on its
port. Desktop uses that connection to record and run. Other programs running as
you on this computer could connect too, which is why the notice asks you to
close the window when you're done, and why Desktop closes it when Desktop
quits.

## Tests

- `tests/test_engine/test_chrome_profile.py`: consent, every refusal, the
launch arguments, owned-only close and a static check that the module has no
cookie, password or keychain call. No Chrome starts.
- `tests/test_e2e/test_chrome_profile_real.py`: real Google Chrome against a
synthetic sign-in page on loopback. It checks that the sign-in is kept across
a close and reopen (from the server side), that a second Desktop refuses the
open profile, and that another Chrome window stays open when Desktop closes
its own. It runs with `OPENADAPT_REAL_CHROME=1` on the GitHub-hosted macOS and
Windows runners (`desktop-test.yml`) and on the Windows lab.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
C:\oa\cpwt\packages\desktop\.venv\Lib\site-packages\pytest_asyncio\plugin.py:306: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session". Set it to "fixture-scope" to keep the current behavior.

warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
============================= test session starts =============================
platform win32 -- Python 3.12.4, pytest-9.2.0, pluggy-1.6.0 -- C:\oa\cpwt\packages\desktop\.venv\Scripts\python.exe
rootdir: C:\oa\cpwt\packages\desktop
configfile: pyproject.toml
plugins: anyio-4.14.2, asyncio-1.5.0
asyncio: mode=Mode.STRICT, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collecting ... collected 43 items

tests/test_e2e/test_chrome_profile_real.py::test_an_elevated_windows_desktop_refuses_real_chrome SKIPPED [ 2%]
tests/test_e2e/test_chrome_profile_real.py::test_sign_in_persists_and_desktop_closes_only_its_window PASSED [ 4%]
tests/test_engine/test_chrome_profile.py::test_notice_hash_is_stable_and_names_the_rules PASSED [ 6%]
tests/test_engine/test_chrome_profile.py::test_create_requires_the_current_notice_and_an_explicit_yes[0000000000000000000000000000000000000000000000000000000000000000-True] PASSED [ 9%]
tests/test_engine/test_chrome_profile.py::test_create_requires_the_current_notice_and_an_explicit_yes[None-True] PASSED [ 11%]
tests/test_engine/test_chrome_profile.py::test_create_requires_the_current_notice_and_an_explicit_yes[current-False] PASSED [ 13%]
tests/test_engine/test_chrome_profile.py::test_create_requires_the_current_notice_and_an_explicit_yes[current-None] PASSED [ 16%]
tests/test_engine/test_chrome_profile.py::test_create_records_consent_and_a_private_empty_directory PASSED [ 18%]
tests/test_engine/test_chrome_profile.py::test_a_changed_notice_refuses_open_until_agreed_again PASSED [ 20%]
tests/test_engine/test_chrome_profile.py::test_unknown_profile_is_refused PASSED [ 23%]
tests/test_engine/test_chrome_profile.py::test_open_launches_official_chrome_on_the_owned_directory PASSED [ 25%]
tests/test_engine/test_chrome_profile.py::test_open_twice_reuses_the_owned_window PASSED [ 27%]
tests/test_engine/test_chrome_profile.py::test_open_deletes_a_stale_devtools_file_before_launch PASSED [ 30%]
tests/test_engine/test_chrome_profile.py::test_open_refuses_a_bad_url PASSED [ 32%]
tests/test_engine/test_chrome_profile.py::test_profile_in_use_is_refused_before_launch_mac SKIPPED [ 34%]
tests/test_engine/test_chrome_profile.py::test_a_stale_lock_from_a_dead_process_is_not_in_use SKIPPED [ 37%]
tests/test_engine/test_chrome_profile.py::test_a_lock_from_another_host_counts_as_in_use SKIPPED [ 39%]
tests/test_engine/test_chrome_profile.py::test_windows_lockfile_held_open_counts_as_in_use PASSED [ 41%]
tests/test_engine/test_chrome_profile.py::test_windows_without_lockfile_is_free PASSED [ 44%]
tests/test_engine/test_chrome_profile.py::test_chrome_exiting_after_launch_is_a_handoff_and_refused PASSED [ 46%]
tests/test_engine/test_chrome_profile.py::test_an_endpoint_that_isnt_ours_is_refused_and_closed[version0] PASSED [ 48%]
tests/test_engine/test_chrome_profile.py::test_an_endpoint_that_isnt_ours_is_refused_and_closed[version1] PASSED [ 51%]
tests/test_engine/test_chrome_profile.py::test_an_endpoint_that_isnt_ours_is_refused_and_closed[version2] PASSED [ 53%]
tests/test_engine/test_chrome_profile.py::test_an_endpoint_that_isnt_ours_is_refused_and_closed[version3] PASSED [ 55%]
tests/test_engine/test_chrome_profile.py::test_an_endpoint_that_isnt_ours_is_refused_and_closed[version4] PASSED [ 58%]
tests/test_engine/test_chrome_profile.py::test_unreachable_endpoint_is_refused PASSED [ 60%]
tests/test_engine/test_chrome_profile.py::test_default_chrome_directories_are_refused PASSED [ 62%]
tests/test_engine/test_chrome_profile.py::test_find_chrome_accepts_only_official_chrome PASSED [ 65%]
tests/test_engine/test_chrome_profile.py::test_chrome_candidates_per_platform FAILED [ 67%]
tests/test_engine/test_chrome_profile.py::test_default_dirs_per_platform PASSED [ 69%]
tests/test_engine/test_chrome_profile.py::test_close_sends_browser_close_to_the_owned_endpoint_only PASSED [ 72%]
tests/test_engine/test_chrome_profile.py::test_close_falls_back_to_the_handle_when_browser_close_fails PASSED [ 74%]
tests/test_engine/test_chrome_profile.py::test_close_does_not_send_browser_close_when_the_endpoint_changed PASSED [ 76%]
tests/test_engine/test_chrome_profile.py::test_close_of_a_profile_desktop_did_not_open_does_nothing PASSED [ 79%]
tests/test_engine/test_chrome_profile.py::test_close_all_closes_every_owned_window PASSED [ 81%]
tests/test_engine/test_chrome_profile.py::test_revoke_refuses_while_open_and_deletes_on_request PASSED [ 83%]
tests/test_engine/test_chrome_profile.py::test_revoke_without_delete_keeps_the_folder PASSED [ 86%]
tests/test_engine/test_chrome_profile.py::test_module_never_reads_cookies_passwords_or_the_keychain PASSED [ 88%]
tests/test_engine/test_chrome_profile.py::test_devtools_file_parsing PASSED [ 90%]
tests/test_engine/test_chrome_profile.py::test_browser_close_frame_is_a_masked_cdp_message_without_origin PASSED [ 93%]
tests/test_engine/test_chrome_profile.py::test_commands_are_window_only PASSED [ 95%]
tests/test_engine/test_chrome_profile.py::test_an_elevated_windows_desktop_refuses_before_launch PASSED [ 97%]
tests/test_engine/test_chrome_profile.py::test_unknown_elevation_counts_as_elevated PASSED [100%]

================================== FAILURES ===================================
_____________________ test_chrome_candidates_per_platform _____________________

def test_chrome_candidates_per_platform() -> None:
win = cp.chrome_candidates(
"win32", {"PROGRAMFILES": r"C:\Program Files", "LOCALAPPDATA": r"C:\Users\u\AppData\Local"}
)
assert [str(p).replace("\\", "/") for p in win] == [
"C:/Program Files/Google/Chrome/Application/chrome.exe",
"C:/Users/u/AppData/Local/Google/Chrome/Application/chrome.exe",
]
mac = cp.chrome_candidates("darwin", {})
> assert str(mac[0]) == "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
E AssertionError: assert '\\Applicatio...Google Chrome' == '/Application...Google Chrome'
E
E - /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
E ? ^ ^ ^ ^ ^
E + \Applications\Google Chrome.app\Contents\MacOS\Google Chrome
E ? ^ ^ ^ ^ ^

tests\test_engine\test_chrome_profile.py:338: AssertionError
============================== warnings summary ===============================
.venv\Lib\site-packages\anyio\pytest_plugin.py:14
C:\oa\cpwt\packages\desktop\.venv\Lib\site-packages\anyio\pytest_plugin.py:14: PytestRemovedIn10Warning: _pytest.python.CallSpec2 has been renamed to CallSpec.
The CallSpec2 alias will be removed in pytest 10.
Update imports to use CallSpec instead.
See https://docs.pytest.org/en/stable/deprecations.html#callspec2-renamed
from _pytest.python import CallSpec2

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ===========================
FAILED tests/test_engine/test_chrome_profile.py::test_chrome_candidates_per_platform
============= 1 failed, 38 passed, 4 skipped, 1 warning in 12.51s =============
2 changes: 1 addition & 1 deletion packages/desktop/openadapt_desktop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
+-- backends/ Storage backend plugins
"""

__version__ = "0.32.3"
__version__ = "0.33.0"
Loading
Loading