Skip to content

fix(browser): use monotonic capture timeout - #488

Open
AcidicSoil wants to merge 1 commit into
agentrhq:mainfrom
AcidicSoil:fix/monotonic-capture-timeout
Open

fix(browser): use monotonic capture timeout#488
AcidicSoil wants to merge 1 commit into
agentrhq:mainfrom
AcidicSoil:fix/monotonic-capture-timeout

Conversation

@AcidicSoil

Copy link
Copy Markdown

Summary

Use a monotonic clock for browser network-capture waits.

waitForCaptureJs() currently derives its deadline from Date.now(). If the host wall clock jumps forward while the wait is active, the capture can time out before the requested elapsed duration has actually passed. performance.now() is monotonic and matches the semantics of an elapsed-time budget.

Regression coverage

Adds a focused test that jumps Date.now() forward by 60 seconds while a capture arrives normally. The test fails with the wall-clock deadline and passes with the monotonic deadline.

Verification

  • npm run typecheck — pass
  • npm run build — pass
  • npx vitest run --project unit src/browser/dom-helpers.test.ts — 10/10 pass
  • git diff --check — pass

The aggregate unit suite also exposes unrelated timing/process flakes on this host; an unmodified main checkout reproduces the Electron launcher timeout. The changed dom-helpers surface remains green.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — low confidence

The automated review could not reach a fully supported conclusion.

Limitations

  • The automated review returned an invalid structured result.

This review is advisory and does not block merging.

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