openai / openai/codex

Browser Use: Browser API documents `networkidle`, but waitForLoadState rejects it

Open
#41,379 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app browser bug
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.825.32147

What subscription do you have?

Plus

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

The Browser runtime documentation advertises networkidle as a supported load state:

type LoadState = "load" | "domcontentloaded" | "networkidle";

type PageWaitForLoadStateOptions = {
  state?: LoadState;
  timeoutMs?: number;
};

It also exposes:

waitForLoadState(options: PageWaitForLoadStateOptions): Promise<void>;

However, the runtime rejects the documented value immediately:

Error: playwright_wait_for_load_state does not support networkidle

This is a mismatch between the generated Browser API documentation/type contract and the runtime implementation.

What steps can reproduce the bug?
  1. Start Browser Use in the Codex macOS app and select the in-app browser.
  2. Create a tab and navigate to a normal page.
  3. Let codex call waitForLoadState with the documented networkidle value:
const tab = await browser.tabs.new();
await tab.goto("https://example.com/");

await tab.playwright.waitForLoadState({
  state: "networkidle",
  timeoutMs: 10000
});
  1. The agent receives the following runtime error:
Error: playwright_wait_for_load_state does not support networkidle
What is the expected behavior?

Either:

  1. waitForLoadState({ state: "networkidle" }) should work as documented, or
  2. networkidle should be removed from the LoadState type used by methods that do not support it.

The generated documentation and runtime validation should expose the same supported values.

Additional information

Environment details:

  • Codex macOS app: 26.825.32147
  • Bundled Browser plugin: 26.825.32147
  • Bundled Codex CLI: 0.150.0-alpha.12.2
  • macOS: 26.5.2 (25F84)
  • Reproduction target: https://example.com/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Browser runtime entry point named playwright_wait_for_load_state and inspect the generated LoadState and PageWaitForLoadStateOptions declarations. Run the provided waitForLoadState reproduction with networkidle, then verify that the runtime behavior and generated contract expose the same supported values.

Written by the indexing model from the issue text.

Assessment

Tech stack
playwright, rust, typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.