Commit Graph

10 Commits

Author SHA1 Message Date
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
Christian Stewart 78a4d2ea5a test(browser): stop gating chromium tests on a top-level-await export
`bun test` fails the coding-agent native/unit job with

  ReferenceError: Cannot access 'CHROMIUM_AVAILABLE' before initialization

in test/tools/browser-attach.test.ts and browser-tab-evaluate.test.ts,
taking the job red on every pull request.

chromium-probe.ts initializes its only export with top-level await. When
a test file importing it is the first file the runner loads, the await
settles before that file evaluates and the binding reads fine. When any
other test file was loaded first, the importer's body runs while the
binding is still in its temporal dead zone, and registration throws at
the `skipIf` call. `bun test <one file>` passes and `bun test --parallel=1
<any earlier file> <that file>` fails, which is why the job fails while a
single-file run does not.

Export the memoized probe as a function and let each test file await it
during its own evaluation, which the runner sequences. The probe still
runs once per process and resolves the executable exactly as before.

Signed-off-by: Christian Stewart <christian@aperture.us>
2026-08-02 05:00:26 -07:00
can1357 80627462b4 test(browser): gated real-Chromium attach tests behind launch probe
- Extracted the chromiumCanLaunch probe from browser-tab-evaluate into a
  shared test/tools/chromium-probe.ts helper.
- The two attached-navigation tests from PR #7006 launch real headless
  Chrome; CI runners without Chrome system libraries (libnspr4 & co.)
  cannot exec the downloaded binary, failing the native/unit bucket.
- Gave both tests 30s timeouts to survive CI cold starts.
2026-07-31 21:25:48 +02:00
can1357 a6c6257574 chore: applied formatter and deduplicated observer stubs in task fixtures 2026-07-31 19:51:52 +02:00
can1357 f46af54f9c fix(browser): preserve screenshot correctness when attached 2026-07-31 19:42:42 +02:00
can1357 ce1ec2103f Merge PR #7006: fix(tools): stop browser automation from stealing focus in an attached browser (@terrxo)
# Conflicts:
#	packages/coding-agent/src/tools/browser/tab-supervisor.ts
2026-07-31 19:42:12 +02:00
can1357 9c1facec10 test(browser): cover attached tab navigation 2026-07-31 19:41:44 +02:00
Nik Divjak b8b0d342da fix(tools): stop browser automation from stealing focus in an attached browser
Attaching over app.cdp_url points automation at a browser the user is driving,
so two behaviors that are correct for a browser we own are wrong there.

pickElectronTarget enumerated CDP targets and took the first usable one, which
is not necessarily the tab in front of the user, and #captureScreenshot always
called page.bringToFront(), which switches the user's visible tab and pulls
window focus on every screenshot.

Connected browsers now prefer a tab that reports document.visibilityState
"visible" and skip the pre-capture activation, accepting the compositor stall
risk that activation avoids. Headless and spawned browsers are unchanged.
2026-07-29 11:26:13 +02:00
danzaio e6b0e76341 fix(browser): cover cdp attach fallbacks 2026-06-10 14:37:58 -03:00
danzaio b73c9bce94 fix(browser): attach to discovered CDP pages 2026-06-10 14:22:55 -03:00