Skip to content

perf(demo): installed browser, one browser process, early OpenCV load (carry-over of openadapt-flow#528) - #1189

Merged
abrichr merged 6 commits into
mainfrom
carry/flow-528
Oct 17, 2026
Merged

abrichr merged 6 commits into
mainfrom
carry/flow-528

Conversation

@abrichr

@abrichr abrichr commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Carry-over of OpenAdaptAI/openadapt-flow#528 (perf/fast-first-run, head 7159f8c5).

Replayed with git format-patch --no-merges origin/main..7159f8c5 (6 commits; the merge of origin/main into the branch is skipped because main is already in the monorepo) and git am -3 --directory=packages/flow onto main. Applied cleanly.

The demo now launches the installed Chrome or Edge through Playwright's
channel option. Without one, it downloads only Chromium's headless shell
instead of the full browser. A channel browser that fails to start falls
back to Playwright's own build. OPENADAPT_FLOW_BROWSER selects auto,
chrome, msedge, or bundled.

The tutorial's record run and both replays share one browser process.
Each run still gets a fresh browser context. The OCR models load on a
background thread while the browser starts.

Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
On a fresh macOS install the first OpenCV import takes 9 to 13 seconds
while the system verifies its native libraries. The demo now starts that
load on a background thread before it starts the browser. The browser
process code moves to a module that does not import OpenCV.

The demo prints one line per stage as it starts, instead of staying
silent until both runs end.

Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
The demo's summary stays at most eight lines. Stage progress now
rewrites a single line on a terminal and prints nothing when output is
piped.

Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
replay, resume, bench, record, the attended service, and generated MCP
tools still launched Playwright's own Chromium, while PlaywrightBackend
picked the installed Chrome. A project pinned under one browser then
replayed under the other, so the qualification environment check halted
the Desktop check-it practice run. All of these paths now go through
launch_chromium.

Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
The attended service now picks and prepares the browser through
launch_chromium, which runs after Playwright starts. The test still checks
that every step runs on the owner thread.

Signed-off-by: Richard Abrich <richard.abrich@mldsai.com>
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