openai / openai/codex

[macOS][26.908.31457] cua_repl js tool is available but cua global is undefined after reset

Open
#44,724 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app browser bug computer-use tool-calls
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using?

ChatGPT/Codex Desktop 26.908.31457 (build 8690). The running process is /Applications/ChatGPT.app/Contents/MacOS/ChatGPT.

Bundled components observed:

  • Codex CLI: 0.154.0-alpha.6.1
  • unified-computer-use@openai-bundled: 26.908.31457
What subscription do you have?

Signed-in ChatGPT account; the exact subscription tier was not inspected for this reproduction.

What platform is your computer?

macOS 26.6.2 (25G83), Apple Silicon (arm64).

What issue are you seeing?

The cua_repl/js MCP tool is present and accepts JavaScript, but the documented cua global is not defined. Browser control therefore fails before creating or selecting an in-app Browser tab.

Following the tool's first-call instructions exactly:

let tab = await cua.createBrowserTab("iab", "https://example.com", { visible: true });

returns immediately with:

cua is not defined

Resetting the JavaScript kernel succeeds, but does not restore the global:

cua_repl/js_reset -> js kernel reset

The required initialization call after reset:

await cua.getState();

returns the same error:

cua is not defined

The failure reproduced again with https://example.com, so it occurs before target-site access or authentication.

What steps can reproduce the bug?
  1. Launch ChatGPT/Codex Desktop on macOS.
  2. Start a task with the bundled unified computer-use/browser integration enabled.
  3. Ask the task to open https://example.com in the visible in-app Browser.
  4. Let it invoke cua_repl/js with the documented cua.createBrowserTab(...) call.
  5. Observe cua is not defined.
  6. Invoke cua_repl/js_reset.
  7. Invoke cua_repl/js with exactly await cua.getState(); as required after a reset.
  8. Observe cua is not defined again.
What is the expected behavior?

The cua_repl/js runtime should inject the documented cua global. cua.getState() should return the enabled surfaces, and cua.createBrowserTab("iab", ...) should create and return an in-app Browser tab binding.

Additional information

This appears related to the current browser/computer-use initialization and lifecycle reports, but none of them contains this exact symptom: the MCP tool itself is callable while its required global is absent.

Related issues:

  • #44518 — cua_repl does not respawn after its host exits; reset does not recover it
  • #42757 — trusted worker crashes before browser attachment on macOS
  • #39591 — in-app Browser runtime exits during initialization on macOS
  • #38549 — browser-control MCP client never becomes ready on macOS

No private target URL, page content, credentials, account identifiers, or raw configuration files are included.

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

Reproduce through the bundled cua_repl/js and cua_repl/js_reset tools, first calling cua.getState() and then cua.createBrowserTab(...) as described. Trace the browser/computer-use initialization and reset lifecycle referenced by issues #44518, #42757, #39591, and #38549. Done means the documented cua global is available after startup and reset, getState() works, and createBrowserTab() returns an in-app Browser tab binding.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, macos, rust
Domain
desktop-dev, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.