Browser and Chrome plugins fail at bootstrap: TypeError Cannot redefine property: process

Resolved 💬 2 comments Opened Jul 14, 2026 by kkpapa Closed Aug 6, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

ChatGPT/Codex Desktop 26.707.71524 (build 5263)

Bundled plugins:

  • browser@26.707.71524
  • chrome@26.707.71524

What subscription do you have?

Authenticated ChatGPT account in the desktop app. Exact plan omitted.

What platform is your computer?

macOS 26.5.1 (build 25F80), Apple Silicon / arm64.

What issue are you seeing?

Both the Codex in-app Browser and Chrome plugin fail deterministically during browser runtime bootstrap, before browser discovery or navigation begins:

TypeError: Cannot redefine property: process
    at .../scripts/browser-client.mjs:33:22
    at SourceTextModule.evaluate
    at importResolved (.../kernel.js:905:27)

The failing code in the bundled client is:

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

The trusted JavaScript runtime intentionally installs a locked process facade first:

Object.defineProperty(runtimeContext, "process", {
  value: trustedProcess,
  writable: false,
  configurable: false,
  enumerable: false,
});

Since ESM executes in strict mode, the assignment to globalThis.process throws immediately.

This affects both browser surfaces because their browser-client.mjs files are byte-identical:

SHA-256:
57ee77a283eb230c6c6d47353af13a25cec4c331b511868c8fbf7ccd3dd1b2f6

What steps can reproduce the bug?

  1. Open ChatGPT/Codex Desktop 26.707.71524 on macOS arm64.
  2. Install and enable either the bundled Browser or Chrome plugin.
  3. Start a fresh Codex task.
  4. Ask Codex to use @Browser or @Chrome.
  5. Run the plugin's documented bootstrap:

``js
const { setupBrowserRuntime } = await import(
"/Users/<user>/.codex/plugins/cache/openai-bundled/browser/26.707.71524/scripts/browser-client.mjs"
);
await setupBrowserRuntime({ globals: globalThis });
``

  1. The dynamic import throws Cannot redefine property: process. No browser backend is queried.

Frequency: 100%. Reproduced repeatedly with both bundled plugins.

What is the expected behavior?

The trusted bundled browser client should import successfully without mutating or replacing the locked global process facade, then continue to Browser/Chrome discovery and setup.

Additional information

Differential tests:

  • The exact unmodified browser-client.mjs imports successfully in an ordinary Node child process.
  • It fails only when evaluated in the trusted Codex runtime where process is intentionally non-writable and non-configurable.
  • A proof copy that keeps the process shim module-local imports past this collision. It then correctly fails the later trust check because the copy is not a trusted bundled client.
  • App and plugin versions match, so this is not a stale cross-version plugin cache.
  • Reinstalling the plugins, restarting Chrome and the app, and using a fresh task do not change the result.

This appears distinct from reports where the client imports and later fails with browser-client is not trusted or a native-pipe error: here the original trusted client throws during module evaluation, before the native bridge is inspected.

Suggested fix:

  • Keep the kernel's locked process facade; do not make it writable/configurable.
  • Make the browser client's Node polyfill module-local (and, if needed, use a module-local global proxy) instead of assigning to globalThis.process.
  • Add an integration test that imports the trusted browser client in a runtime where globalThis.process is already non-writable/non-configurable, asserts that the global is unchanged, and verifies setup reaches browser discovery.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #32925
  • #32936
  • #32938
  • #32954
  • #32991

Powered by Codex Action

pegaentregasac2-dotcom · 1 month ago

TITLE: Chrome bundled plugin: stale cache migration, non-atomic uninstall, and native host provisioning failure on Windows

Summary

The bundled Chrome plugin had two consecutive failures:

  1. A stale cached plugin (26.623.141536) survived repair, reset, uninstall/reinstall, and application updates. Its browser client failed during trusted-module evaluation with:
TypeError: Cannot redefine property: process
  1. After controlled cache regeneration fixed the runtime import, enabling the current Chrome plugin (26.707.91948) still did not provision the Windows Native Messaging host. The extension therefore continues to display “Download ChatGPT”, and Chrome discovery fails with:
Browser is not available: extension

A plugin uninstall attempt also failed non-atomically, leaving a partially deleted cache.

Environment

  • Windows 10 Pro 22H2, build 19045.6466
  • Codex Desktop: 26.707.12708.0
  • Bundled Codex CLI/command runner: 0.144.5
  • Current Chrome plugin: 26.707.91948
  • Google Chrome: 150.0.7871.125
  • ChatGPT Chrome Extension: 1.2.27203.26575_0
  • Codex task/feedback ID: 019f66dc-0f03-7ce1-a1ef-5b43af4a716e

Initial stale-cache state

The active cached Chrome plugin was:

C:\Users\<user>\.codex\plugins\cache\openai-bundled\chrome\26.623.141536

It contained 375 files and used this browser-client SHA-256:

97669f77b3ca7114a2df05d55646416ea34b28100c07213ef9f643803449ef2f

The client contained an unconditional assignment equivalent to:

globalThis.process = processShim;

Importing it in the trusted runtime failed before browser discovery or extension communication.

The configured bundled marketplace was also stale and contained the same old Chrome package. Therefore, deleting only the active cache would have reconstructed the same broken version.

The stale cache persisted after:

  • JavaScript runtime reset
  • Codex/ChatGPT restart
  • Chrome restart
  • Application repair
  • Application reset
  • Application uninstall/reinstall
  • Chrome extension removal/reinstallation
  • Multiple fresh tasks

Controlled regeneration

The stale Chrome cache and bundled marketplace were moved to a reversible quarantine with SHA-256 inventories before and after the move.

Results:

  • Chrome cache: 375 files
  • Bundled marketplace: 773 files
  • Total verified: 1,148 files
  • Hash differences: 0
  • No files were deleted

After restart, Codex regenerated the marketplace and materialized:

Chrome plugin: 26.707.91948
Files: 375
browser-client SHA-256:
7abc8b22abade944bcd80135500416c7aee60c0e94290c7d644b54428a0013ab

The hash was present in NODE_REPL_TRUSTED_BROWSER_CLIENT_SHA256S. The unsafe global process assignment was absent.

The regenerated browser client imported successfully and setupBrowserRuntime() completed. This confirms that the original trusted-runtime collision was fixed by the current package.

Extension and profile checks

The official extension checker reported:

Selected profile: Profile 9
Installed: true
Enabled: true
Extension version: 1.2.27203.26575_0
Extension ID: hehggadaopoacecdllhhajmbjkdcmajg

Chrome was running with only the intended user profile open.

The extension was previously installed only in Profile 9 while Local State selected Profile 8. After closing the other profiles and restarting, Profile 9 became correctly selected.

Native host failure

The official native-host checker reported:

Manifest:
C:\Users\<user>\AppData\Local\OpenAI\extension\com.openai.codexextension.json

Registry:
HKCU\Software\Google\Chrome\NativeMessagingHosts\com.openai.codexextension

Both were absent:

registryManifestPath: null
exists: false
correct: false

The current plugin package contains both:

scripts\installManifest.mjs
extension-host\windows\x64\extension-host.exe

Nevertheless, the host was not created after:

  • Enabling the Chrome plugin
  • Waiting after activation
  • Fully restarting Codex with the plugin enabled
  • Keeping Chrome open only in the profile containing the enabled extension
  • Retrying the browser connection after two seconds

Both connection attempts returned:

Browser is not available: extension

No manual execution of installManifest.mjs, Registry editing, or native-host repair was performed.

Non-atomic uninstall

Attempting to uninstall the bundled Chrome plugin from the UI failed.

The official plugin-management uninstall call also returned:

Failed to uninstall plugin.

The failed uninstall left this partial state:

  • chrome@openai-bundled changed to enabled = false
  • Original package size: 375 files
  • Remaining files: 60
  • Plugin manifest: removed
  • browser-client.mjs: removed
  • Native dependency subtree: partially retained
  • classic-level.node: retained

Because the manifest had already been removed, subsequent uninstall attempts could not complete.

The 60 residual files were moved to a second verified quarantine. After restart, Codex reconstructed the complete 375-file package from the official marketplace, while keeping the plugin disabled. Re-enabling it still did not provision the native host.

Expected behavior

  1. Application updates should invalidate stale bundled marketplace snapshots and plugin caches when their versions differ from the installed application.
  2. The production browser client should import in the trusted runtime without replacing its locked process facade.
  3. Plugin uninstall should be atomic or resumable.
  4. A failed uninstall should roll back instead of deleting the manifest and leaving native dependencies behind.
  5. Enabling or reinstalling the Chrome plugin should create the Native Messaging manifest and Registry entry.
  6. The extension should connect and allow listing open tab titles.

Impact

  • The original runtime crash is fixed after cache regeneration.
  • Chrome control remains unavailable because the native host is not provisioned.
  • The extension incorrectly appears to require downloading ChatGPT even though Codex is installed and running.
  • The bundled plugin cannot be cleanly uninstalled through the UI.
  • No tab titles or page contents can be accessed.

Suggested regression tests

  1. Upgrade with an older bundled marketplace and cache already materialized.
  2. Import the production browser client with a non-writable, non-configurable trusted process facade.
  3. Uninstall Chrome while its runtime or native dependency has previously been loaded.
  4. Simulate an interrupted uninstall and verify transactional rollback or resumability.
  5. Enable Chrome from a clean, disabled state and verify creation of both the manifest and Registry entry.
  6. Verify connection with the extension installed in a non-default Chrome profile.
  7. Ensure the extension reports a precise missing-host error instead of only “Download ChatGPT”.

No private browsing data, cookies, credentials, page contents, or account information are required to reproduce this issue.
:::