Commit Graph

18 Commits

Author SHA1 Message Date
brymko 271e621a02 test(coding-agent): synchronized browser rejection checks
Waited for the observable warning event instead of assuming late continuations settle within a fixed wall-clock delay under CI load.
2026-08-05 17:47:03 +08:00
brymko fe086df7bf fix(coding-agent): aborted browser runs before draining
Closed worker and cmux run signals before yielding for floating-rejection drainage. Stale promise continuations can no longer begin page navigation after evaluated code returns.
2026-08-05 16:45:36 +08:00
brymko 5c0187dec5 fix(coding-agent): isolated promise combinator tracking
Used a run-scoped Promise subclass instead of mutating native combinator methods. Evaluated code can now freeze its Promise constructor without breaking cleanup or later browser runs.
2026-08-05 16:43:00 +08:00
brymko af35be1105 fix(coding-agent): tracked browser promise combinators
Observed Promise.all and Promise.race results derived from browser calls during each evaluated run. User catch continuations that rethrow browser failures now fail the owning run without changing native await behavior.
2026-08-05 16:43:00 +08:00
brymko bb5d64557d fix(coding-agent): preserved late browser rejections
Logged late user continuation failures in cmux runs and delayed worker rejection folding until request-interception cleanup completed. This closes both windows where missing awaits could be silently dropped.
2026-08-05 15:46:38 +08:00
brymko dd0b7b3176 fix(coding-agent): reported late browser continuations
Logged user continuation rejections that settle after their browser run has ended. This preserves the completed result while making missing awaits visible instead of silently dropping them.
2026-08-05 15:46:38 +08:00
brymko 71c26e5958 fix(coding-agent): reported rethrown browser continuations
Tracked whether user continuation callbacks create each descendant rejection. Browser errors that user code rethrows now fail the owning run instead of being contained as propagated helper failures.
2026-08-05 15:45:17 +08:00
brymko 2fd469de75 fix(coding-agent): corrected browser rejection containment
Scoped browser-error markers to each run and contained only propagated browser failures. Routed floated user continuations into failed runs and added worker coverage for native await plus every continuation method.
2026-08-05 15:45:17 +08:00
brymko 364e13c49e fix(coding-agent): contained browser timeout rejections
Observed every browser facade continuation so fire-and-forget helper
timeouts cannot wedge or kill a tab worker. Preserved native Promise
identity for callers and test matchers.
2026-08-05 14:31:03 +08: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 707932e786 Merge PR #5588: fix(browser): observe raw promises before target close (@serverinspector)
# Conflicts:
#	packages/coding-agent/src/tools/browser/tab-worker.ts
#	packages/coding-agent/test/tools/browser-tab-evaluate.test.ts
2026-07-18 21:04:16 +02:00
roboomp e0358b77a0 fix(browser): unregister fired once request handlers
- Removed the once wrapper from Puppeteer's request emitter on first fire so it cannot leak into later runs.
- Added regression coverage asserting a fired once handler leaves zero residual request listeners.

Fixes #6004
2026-07-18 16:31:10 +00:00
roboomp fe2fdf6564 fix(browser): isolated request interception per run
- Removed run-scoped Puppeteer request handlers and disabled interception on every browser.run exit path.
- Recycled workers when bounded interception cleanup cannot restore the tab, with raw CDP recovery for held requests.
- Added live Chromium coverage for held requests, normal traffic restoration, and thrown setup calls.

Fixes #6004
2026-07-18 16:22:40 +00:00
serverinspector d52084f536 fix(browser): observe raw promises before target close 2026-07-15 14:35:44 +00:00
can1357 3047c27c33 fix(test): skip real-browser tab.evaluate test when chromium cannot exec
- Exported ensureChromiumExecutable so the test can probe launchability.
- CI runner holds the downloaded Chrome but lacks libnspr4 & co., so the
  binary fails at dynamic-link time; probe --version and skipIf instead
  of failing the release run.
2026-07-14 02:12:21 +02:00
can1357 df7193731f fix(test): raised timeout for real-browser tab.evaluate test
- CI runner cold Chromium launch exceeded bun's 5s default test timeout,
  failing the v16.5.0 release run; only test in suite launching a real browser.
2026-07-14 01:53:11 +02:00
can1357 8c8afaf477 fix(browser): made tab evaluation use the main world 2026-07-13 00:05:43 +02:00