Skip to content

fix: forward waitUntil through navigate so adapters can skip the load-event wait#107

Open
ngaurav wants to merge 1 commit into
mainfrom
fix/navigate-wait-until
Open

fix: forward waitUntil through navigate so adapters can skip the load-event wait#107
ngaurav wants to merge 1 commit into
mainfrom
fix/navigate-wait-until

Conversation

@ngaurav

@ngaurav ngaurav commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #106.

Never-idle sites (e.g. zillow.com, which streams analytics requests indefinitely) never fire the browser load event, so every page.goto() timed out after 30s even though the document had rendered — zillow/rentals failed on every run.

  • protocol.ts: add waitUntil?: 'load' | 'none' to BrowserRuntimeCommand
  • page.ts: Page.goto forwards waitUntil in the navigate command (primary and stale-identity-retry paths)
  • local-cloak/actions.ts: map 'none' to Playwright's 'commit'; default remains 'load', so behavior is unchanged unless an adapter opts in

Backward compatible in both directions: old daemons ignore the extra field; old CLIs never send it.

Testing

  • npx tsc --noEmit clean
  • npx vitest run src/browser/: 34 files, 460 tests pass (new provider test for the 'none''commit' mapping; forwarding assertion added to the existing Page.goto test)
  • End-to-end: with the repo daemon and a zillow adapter passing { waitUntil: 'none' }, webcmd zillow rentals "San Francisco, CA" --max-rent 5000 --min-beds 2 --pets --parking completes in ~11s; previously it burned two 30s load-event stalls and exceeded the 60s command budget

🤖 Generated with Claude Code

…-event wait

Never-idle sites (e.g. zillow.com streaming analytics) never fire the load
event, so every page.goto() timed out at 30s even though the document had
rendered. Page.goto now forwards its waitUntil option in the navigate
command, and the local-cloak runtime maps 'none' to Playwright's 'commit'
instead of always hard-coding 'load'.

Fixes #106

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — medium confidence

The automated review could not reach a fully supported conclusion.

Findings

  1. SKILL — Adapters can now pass `{ waitUntil: 'none' }` to `Page.goto()` to skip waiting for the browser load event, mapping to Playwright's 'commit' state.
    • Changed: src/browser/page.ts
    • Evidence: async goto(url: string, options?: { waitUntil?: 'load' | 'none'; settleMs?: number }): Promise<void> {
    • Suggested update: skills/webcmd-adapter-author/SKILL.md
    • Why: The adapter authoring skill guide is not in the provided context, but it should document the new `waitUntil` option for `Page.goto` so developers writing adapters know how to handle never-idle sites.

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.

[Bug]: local-cloak navigate hard-codes waitUntil 'load'; Page.goto never forwards waitUntil, so never-idle sites (zillow.com) always time out

1 participant