Skip to content

fix(driver): wait for network and render quiet - #281

Merged
solp721 merged 2 commits into
developfrom
codex/175-settle-readiness
Oct 6, 2026
Merged

solp721 merged 2 commits into
developfrom
codex/175-settle-readiness

Conversation

@amazon7737

Copy link
Copy Markdown
Member

A single pending fetch could reach network idle before its response, and deferred rendering could leave a skeleton in the next observation. Continuous polling could instead consume the entire timeout.

Chrome now requires a quiet interval across nonexcluded request identities/statuses and document mutations. Pending requests keep the wait active; a new response or render restarts the interval. The independent, expiring DOM observer preserves exact-reference guards. One deadline also bounds hung tool calls and the final sleep.

Consumers can configure ChromeDriverOptions.settle.ignoreRequests with URL substrings. Those defaults apply to engine and internal waits, with individual per-call overrides. Excluded requests remain cumulative evidence and still fail assertions; this does not change benign or frozen scenarios.

Closes #175.

Validation:

  • Typecheck, build, full workspace/benchmark-script/demo tests, boundaries, language and diff checks pass.
  • All 30 Chromium probe/reference tests pass.
  • Real MCP 1.8.0 document-reference and cumulative-network regressions pass, including deterministic replay.
  • npm run test:settle uses committed local fixtures and public Driver/engine APIs. It checks a pending fetch followed by deferred rendering, polling exclusions with an unrecovered 503 still failing the built-in guard, continuous DOM mutation reaching its cap, and a server-verified commit with zero model calls.
  • One local baseline comparison against develop 31cfed0, with a 400ms quiet interval: the original wait returned in 423ms while the fetch was pending; the fix waited 2764ms through completion and rendering. Excluded polling took 543ms instead of 2212ms. These are fixture observations, not general latency estimates.
  • The MCP CI job now runs the new fixture and preserves its JSON report.

Settling remains best effort. Missing DOM measurements fall back to network waiting; numeric response status does not prove a streamed body finished. CSS-only changes, shadow/frame rendering, continuous DOM updates and work scheduled beyond the quiet window still require explicit expect/waitFor checks. No hosted model was used.

@cairn-pingu cairn-pingu Bot added area/build Build, package, or dependency changes area/docs Documentation or specs area/harness Harness engine changes area/repo Repository automation or process size/L Large pull request status/0-draft Draft pull request labels Oct 6, 2026
@cairn-pingu

cairn-pingu Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🐧 Performance briefing

  • Package tarball: +1128 B (+0.48%). Browser gzip: 0 B (0%).
  • Observed replay medians: navigation: +24.4%; form: +30.64%; stateful: +23.82%.
  • Execution across both revisions: 24/24 passed; engine LLM calls: 0; observed LLM calls: 0.
  • Timing includes server/browser startup and awaited cleanup; small samples and CI noise do not prove an improvement or regression. Residual order bias may remain.
Detailed measurements

PR performance comparison

Before: 31cfed0
After: 797391e

All measured attempts passed with zero engine-reported and observed LLM calls.

Package size

Size Before bytes After bytes Delta bytes Change
Package tarball 237067 238195 +1128 +0.48%
Package unpacked 875969 880980 +5011 +0.57%
Browser bundle 69557 69557 0 0%
Browser bundle gzip 24067 24067 0 0%

Replay elapsed time

Tier N before / after Median before ms Median after ms Delta ms Change Status
navigation 4 / 4 2595.33 3228.57 +633.23 +24.4% higher median (informational)
form 4 / 4 3789.6 4950.6 +1161 +30.64% higher median (informational)
stateful 4 / 4 4874.49 6035.48 +1160.99 +23.82% higher median (informational)
Tier Failures before / after Engine LLM calls before / after Observed LLM calls before / after
navigation 0 / 0 0 / 0 0 / 0
form 0 / 0 0 / 0 0 / 0
stateful 0 / 0 0 / 0 0 / 0

Raw measurements and job log

@amazon7737
amazon7737 marked this pull request as ready for review October 6, 2026 02:13
@cairn-pingu cairn-pingu Bot added status/1-needs-review Ready for review and removed status/0-draft Draft pull request labels Oct 6, 2026

@solp721 solp721 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@solp721
solp721 merged commit f053f47 into develop Oct 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build, package, or dependency changes area/docs Documentation or specs area/harness Harness engine changes area/repo Repository automation or process size/L Large pull request status/1-needs-review Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants