Skip to content

feat(wait): add bounded Chromium network-idle predicate - #205

Merged
yashranaway merged 2 commits into
mainfrom
feat/204-network-idle-wait
Sep 20, 2026
Merged

yashranaway merged 2 commits into
mainfrom
feat/204-network-idle-wait

Conversation

@SarthakWade

Copy link
Copy Markdown
Collaborator

Summary

  • add wait --network-idle as an optional predicate that composes with URL, text, and settled waits
  • track bounded Chromium CDP requests with a 500 ms quiet window and explicit persistent-connection exclusions
  • report the feature through capabilities and fail immediately with UNSUPPORTED_CAPABILITY on WebKit
  • update the CLI, protocol schema, generated SDKs, agent skill, architecture decision, and command documentation

Safety and compatibility

  • preserve the existing bare wait settled-page behavior and wire request
  • keep request URLs, identifiers, headers, bodies, and timings out of wait responses
  • cap tracking at 4,096 request IDs and 512 bytes per ID, failing closed on overflow
  • keep all waits bounded by the existing timeout contract

Validation

  • pnpm test
  • pnpm test:runtime
  • pnpm test:npm
  • Python SDK: 42 pytest tests, mypy, ruff check, and ruff format check
  • pnpm --filter @headless/app build
  • pnpm --filter @headless/web lint
  • pnpm --filter @headless/web build
  • pnpm test:e2e:mac
  • Linux protocol suite passed in Docker; local browser E2E image setup was blocked by repeated deb.debian.org connection timeouts and is left to the required CI gate

Closes #204

@yashranaway yashranaway left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

wait --network-idle is additive and engine-honest.

Bare wait still means settled. Chromium tracks CDP request IDs only, with a 500 ms quiet window, 4,096 ID cap, 512-byte ID cap, and overflow that never reports idle. WebSocket and EventSource are excluded. Wait responses do not grow request URLs, headers, or bodies.

WebKit returns UNSUPPORTED_CAPABILITY immediately instead of using page-world diagnostics. The capability bit matches that. macOS E2E asserts the typed failure; Linux E2E covers timeout and a successful quiet wait.

CI is green.

@yashranaway
yashranaway merged commit 55c3194 into main Sep 20, 2026
41 of 42 checks passed
@yashranaway
yashranaway deleted the feat/204-network-idle-wait branch September 20, 2026 10:53
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.

G5: wait for Chromium network idle

2 participants