Chrome/Browser plugin 26.707.71524 fails to import in node_repl: Cannot redefine property: process

Open 💬 3 comments Opened Jul 14, 2026 by FlyingFSR

Summary

The bundled Chrome/Browser plugin cannot be imported by the current Codex node_repl trusted-module runtime. Module evaluation fails before setupBrowserRuntime() is reached:

TypeError: Cannot redefine property: process
    at .../chrome/26.707.71524/scripts/browser-client.mjs:33:22
    at SourceTextModule.evaluate (node:internal/vm/module:233:26)
    at importResolved (.../kernel.js:905:27)

This makes both Chrome control and the in-app Browser client unusable in the affected runtime.

Environment

  • ChatGPT desktop app: 26.707.71524 (build 5263)
  • Bundled Codex CLI: codex-cli 0.144.2
  • Chrome plugin: 26.707.71524
  • browser-client.mjs SHA-256: 57ee77a283eb230c6c6d47353af13a25cec4c331b511868c8fbf7ccd3dd1b2f6
  • macOS: 26.5.2 (build 25F84)
  • Codex task ID: 019f5dd8-bc64-7503-bf2b-6e7c79f90437

The bundled Chrome and in-app Browser plugins contain an identical browser-client.mjs with the same hash.

Reproduction

From a fresh node_repl kernel:

await import("/Users/<user>/.codex/plugins/cache/openai-bundled/chrome/26.707.71524/scripts/browser-client.mjs");

The import fails immediately with TypeError: Cannot redefine property: process. It reproduces after:

  • resetting the JavaScript kernel
  • restarting Chrome
  • restarting the desktop app
  • removing and reinstalling the Chrome plugin
  • restarting both Chrome and the desktop app after reinstall

The reinstall restores the same plugin version and file hash.

Root cause

The current node_repl kernel intentionally installs a safe ambient process facade in its trusted context:

defineLockedGlobal(trustedContext, "process", trustedProcess);

function defineLockedGlobal(runtimeContext, name, value) {
  Object.defineProperty(runtimeContext, name, {
    value,
    writable: false,
    configurable: false,
    enumerable: false,
  });
}

The allowlisted browser client is evaluated in that trusted context, but its bootstrap unconditionally installs a second process shim:

globalThis.process = processShim;
globalThis.global = globalThis.global ?? globalThis;
globalThis.global.process = processShim;

The first assignment is at browser-client.mjs:33 and attempts to replace the already locked property. ES-module evaluation stops there, so setupBrowserRuntime() is never exported/called.

A normal untrusted local module can assign globalThis.process; the collision is specific to the trusted context used for the allowlisted production browser client.

Expected behavior

The production browser client should import successfully under the trusted node_repl context and make setupBrowserRuntime() callable.

Suggested repair

  1. Do not unconditionally replace globalThis.process or globalThis.global.process when the trusted runtime already supplies a locked safe facade.
  2. Audit bundled dependencies for the passive process fields they require. Reuse the runtime facade and narrowly extend the facade or remove Node-environment assumptions where needed.
  3. Add an integration test that imports the production browser-client under a trusted context with a non-writable, non-configurable process property.

Making the trusted process property writable does not appear desirable because the lock protects the Node REPL transport and host process.

Impact and exclusions

The failure occurs before browser discovery or IPC. Therefore Chrome process state, extension enablement, native-host setup, website login state, page content, and website rate limits are not reached. No private browsing data is needed to reproduce this issue.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗