Skip to content

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

Open

Description

@jaglogaiyan

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:

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

Activity

  1. added
    bug
    app
    tool-calls
    on Sep 11, 2026
  2. jaglogaiyan commented on Sep 11, 2026

    @jaglogaiyan
    Author

    Additional regression-boundary evidence:

    Browser control was working on this machine until the desktop app was updated, then the cua is not defined failure began on the new release.

    Local Codex desktop logs corroborate the release transition:

    • 2026-09-11T02:40:35Z: desktop release 26.707.72221
    • 2026-09-11T03:03:25Z: desktop release 26.908.31457
    • Current failing installation: 26.908.31457 (build 8690), with unified-computer-use@openai-bundled 26.908.31457

    The exact public-page reproduction in the issue was performed after that transition. This narrows the observed regression boundary to 26.707.72221 -> 26.908.31457 on the same Apple Silicon Mac.

  3. littlePoBoy commented on Sep 18, 2026

    @littlePoBoy

    I’m seeing the same cua global issue on a newer Codex Desktop version.

    Environment

    • Codex Desktop: 26.915.31029
    • macOS: 26
    • Apple Silicon (arm64)

    Reproduction

    The node_repl JS tool is available and executes JavaScript normally, but the cua global is not injected.

    Running:

    typeof cua

    returns:

    "undefined"
    

    And:

    await cua.getState()

    fails with:

    cua is not defined
    

    So the failure occurs before any browser/website interaction.

    I noticed this issue is reported against 26.908.31457, while I’m on 26.915.31029, but the behavior appears to be the same.

    Could you confirm whether this is still a known/unfixed regression in the newer builds? If there is a fixed version or a recommended workaround, I’d appreciate any guidance.

    Thanks!

  4. Jinkagirl commented on Nov 5, 2026

    @Jinkagirl

    Additional macOS reproduction on desktop version 26.1029.61003

    Observed November 5, 2026, on:

    Component Version
    ChatGPT/Codex desktop 26.1029.61003, build 24614
    macOS 27.0, build 26A428, Apple Silicon
    unified-computer-use 26.1029.61003
    Bundled @oai/cua 0.2.6
    Chrome 156.0.8078.80

    The configured production updater reports the app is up to date.

    The failure occurs in the dedicated mcp__cua_repl.js tool supplied by unified-computer-use@openai-bundled. It was not invoked through the general node_repl tool.

    The recorded calls used the documented cua.getTab operation to select an existing Chrome tab. The installed integration explicitly permits this as the first call, including after reset.

    Four attempts between 3:43:29 p.m. and 3:53:29 p.m. CST returned:

    cua is not defined
    

    The results include:

    isError: true
    error_code: "reference_error"
    codex/nodeReplExecutionDurationMs: 0
    

    Both intervening mcp__cua_repl.js_reset({}) calls returned js kernel reset, but the subsequent calls failed identically. No stack trace was returned.

    The integration configures this automatic startup import:

    await import("@oai/cua/tinyskyAlt");

    The bundled module is designed to assign the runtime to globalThis.cua. Desktop logs record cua_repl reaching ready without a startup error before the first failed call.

    The underlying cause remains unknown. The inspected records do not show whether the automatic import ran, whether it raised an exception, or whether it initialized the same execution context used by the tool calls.

    Could the maintainers provide a fixed build or supported recovery procedure, or instructions for capturing that specific startup-import trace?

    This matches the original issue’s symptom, but does not establish an identical underlying cause. No application files, security settings, or browser authentication state were changed.

  5. oliverxchen commented on Nov 17, 2026

    @oliverxchen

    I encountered this on ChatGPT macOS, Work mode, version 26.1111.21308 (build 27194) and identified the cause in my case.

    My project’s .codex/config.toml contained a restrictive shell_environment_policy.include_only list that omitted the environment variables required by the bundled CUA runtime.

    The symptoms matched this issue:

    • The dedicated mcp__cua_repl.js tool returned cua is not defined.
    • Resetting the kernel succeeded but didn’t resolve it.
    • Desktop logs reported cua_repl as ready, without a startup error.
    • nodeRepl.env existed but was empty.
      A new Work conversation outside the project initialized CUA successfully, which isolated the problem to project configuration.

    I appended these patterns to the existing include_only list:

    "NODE_REPL_*",
    "CUA_REPL_*",
    "BROWSER_USE_*",
    "SKY_*",
    "CODEX_CLI_PATH",
    "CODEX_HOME",

    After fully restarting the app, CUA initialized successfully in the original resumed conversation, listing browsers, tabs, and native apps. No runtime files, trust hashes, or Node installations were changed.

    Potential improvement: distinguish user shell environment filtering from the configuration required by app-managed runtime workers. If that separation is inappropriate, validate that the effective environment retains the required settings and report which policy filtered them out.

    For example:

    CUA initialization cannot proceed because required runtime
    settings are missing from the execution environment:
    
    <list missing variables>
    
    This is likely due to setting `shell_environment_policy.include_only`.
    Check the project and user .codex/config.toml files.
    

    Reporting an initialization failure would be much more actionable than marking the MCP server ready and subsequently returning cua is not defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbrowserbugcomputer-usetool-calls

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions