codex icon indicating copy to clipboard operation
codex copied to clipboard

[Windows 10][Junction][IAB] Browser unavailable after moving .codex; explicit CODEX_HOME restores discovery, 60s split calls allow DOM read

Open 2977266752-tech opened this issue 3 weeks ago • 6 comments

Summary

After moving the Codex user data directory from C: to E: and leaving a Windows directory junction at the default .codex location, the ChatGPT desktop app's built-in browser (IAB) could display https://example.com/ normally, but the agent could not attach to it:

Browser is not available: iab

An app repair, update check, and uninstall/reinstall did not resolve this. Explicitly setting CODEX_HOME to the real E: path, then restarting Windows, appeared to restore IAB tab discovery. However, a page-read attempt still exceeded the default JavaScript tool deadline and reset the kernel. Using timeout_ms: 60000 and splitting discovery, browser binding, tab binding, and DOM reading into separate tool calls successfully returned a real DOM snapshot.

This is one successful recovery sequence, not proof of a permanent fix or of junctions being the sole root cause.

Environment

  • OS: Windows 10 Pro 22H2, build 19045 (x64).
  • Desktop app Windows package reported by PowerShell: 26.1103.3517.0.
  • Bundled browser plugin directory: 26.1103.31037; the configured BROWSER_USE_CODEX_APP_VERSION matched it.
  • Initial default config path: C:\Users\<user>\.codex (Junction) -> E:\<redacted>\CodexHome (existing real directory).
  • CODEX_HOME: initially unset; later set as a Windows user environment variable pointing directly to E:\<redacted>\CodexHome.
  • Initial NODE_REPL_TRUSTED_SERVICES used the C: junction path; after the environment/path adjustment, the browser service reference and trusted paths were verified to use the real E: path.
  • The browser-service.mjs file existed both before and after. Normal Codex / node_repl.exe processes were present.

Reproduction / observations before workaround

  1. Run the desktop app with C:\Users\<user>\.codex as a junction to the relocated directory on E: (and CODEX_HOME unset).
  2. Open a local Codex chat; manually open https://example.com/ in the built-in browser pane.
  3. The webpage renders correctly in the pane.
  4. Ask the agent to inspect the current IAB tab. Browser discovery exposes only Codex MCP Apps / mcpapps, not iab; attempted IAB selection reports Browser is not available: iab.
  5. Repair the app using Windows Settings and reinstall it. The error persists.

Recovery attempt and measured results

A. Explicit real CODEX_HOME

Set the Windows user variable to the real destination directory (not the C: junction), restart Windows, and verify in a new PowerShell session:

[Environment]::GetEnvironmentVariable("CODEX_HOME", "User")
$env:CODEX_HOME

Both pointed to the E: directory. In config.toml, the trusted code path and browser service path also referenced E:; there was no remaining C: browser-service reference in the checked setting. The junction itself was left intact, and no project/user data was deleted.

IAB could now discover the already-open Example Domain tab (URL https://example.com/), but that discovery took 25.234 s.

A subsequent combined DOM-read attempt failed after 33.5809 s:

js execution timed out; kernel reset, rerun your request

B. Separate CUA calls with timeout_ms: 60000

With the IAB tab already open, the agent ran separate calls (each configured with a 60 s tool timeout):

Operation Observed tool time
cua.getState() 26.9900 s
cua.getBrowser({id:"iab"}) 8.6985 s
iabBrowser.tabs.get("1") 10.0223 s
One tab.playwright.domSnapshot() 1.5351 s

The tool discovered an IAB backend and the existing tab (Example Domain, https://example.com/) and returned actual DOM content, including the multilingual explanatory paragraphs and Learn more link. No kernel reset occurred in this successful run.

These numbers are from the assistant's reported tool timings, not independent system-level profiling. Only this single end-to-end read was verified; navigation, repeated reads, and longer-term stability have not been validated.

Expected behavior

  • IAB registration should work when the default .codex directory is a Windows junction, or the app should clearly report an unsupported layout and suggest a safe CODEX_HOME configuration.
  • Browser discovery and binding should not take ~9–27 s for a simple open tab, or tool deadlines should account for realistic initialization time.
  • A failed read should not silently devolve into an opaque JavaScript kernel reset.

Questions for maintainers

  1. Are Windows junctions supported for the Codex home directory? Is path canonicalization for trusted browser-service discovery involved here?
  2. Why are cua.getState(), browser binding, and tab binding so slow even after iab becomes available?
  3. Could the desktop app provide an actionable warning for real-path / junction mismatch and handle a slow Browser handshake without losing the JS kernel?

Related issues

  • #54036 — Windows IAB binding problem with a symlinked Codex home.
  • #39766 — slow IAB commands and 30-second Node REPL resets.
  • #58675 — Windows IAB page renders but backend discovery/binding fails.

All filesystem paths have been anonymized, and this report contains no user project names, credentials, cookies, conversation IDs, or full local logs.

2977266752-tech avatar Nov 06 '26 03:11 2977266752-tech

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

  • #59660
  • #58675
  • #59586

Powered by Codex Action

github-actions[bot] avatar Nov 06 '26 03:11 github-actions[bot]

Follow-up (2026-11-06): production product page still times out

Important limitation to the reported recovery: a separate Codex chat attempted to read a real 1688 product detail page that was already visibly rendered in the IAB pane. The agent did not retrieve product details, SKU data, or images. Two read attempts each reported a JavaScript tool timeout after approximately 34 seconds:

js execution timed out; kernel reset

This differs from the successful single read of the static https://example.com/ test page. We have not verified whether that other chat applied timeout_ms: 60000 to each individual tool call, nor whether the time was spent in tab binding, page-control setup, or actual DOM extraction. Therefore, the workaround should currently be described as partial recovery (IAB discovery and one static-page DOM snapshot), not reliable production-page automation.

No product identifiers, seller information, screenshots, credentials, or private local paths are attached.

2977266752-tech avatar Nov 06 '26 04:11 2977266752-tech

Triage follow-up: comparison with suggested duplicates

Thanks for the duplicate detection. I reviewed #59660, #58675, and #59586.

  • #59660 and #58675 cover the initial symptom well: a visible IAB tab, mcpapps as the only discovered provider, and Browser is not available: iab. However, this report does not contain local log evidence of a client-new-thread ownership mismatch or a No ChatGPT browser route message; I do not want to claim those as this installation's root cause.
  • #59586 covers slow Windows browser-control calls and Node REPL kernel resets. Our observed timing measurements and the 34-second failure on a more complex page are consistent with that class of symptom, but no proxy/VPN cause has been verified for this machine.
  • Potential distinguishing observation here: before setting the Windows user CODEX_HOME, the default .codex path was a junction to another drive, and IAB was unavailable. After CODEX_HOME was explicitly set to the destination's physical path and Windows restarted, IAB discovery and an independent DOM snapshot on https://example.com/ succeeded, albeit slowly. This is a temporal association, not a controlled proof that the junction causes the failure.
  • Recovery remains partial: a separate chat still timed out twice attempting to read an already-rendered third-party product page. Whether the 60-second per-call timeout and split-call technique was actually used in those attempts is unverified.

This issue may be merged with an existing report if maintainers prefer. The reason for retaining this case as a separate data point is the Windows 10 + relocated/junctioned home configuration, the before/after CODEX_HOME observation, and the measured transition from IAB-unavailable to successful static-page DOM reading. No additional tests are claimed in this comment, and no private logs or paths are being attached.

2977266752-tech avatar Nov 06 '26 05:11 2977266752-tech

Another successful recovery on Windows with a similar junction-based Codex home.

Before the change, the in-app browser could display a page, but cua.listBrowsers() listed only mcpapps and selecting iab returned Browser is not available: iab. Windows app Repair and resetting the CUA session did not restore discovery. The installed Codex package observed before the restart was 26.1103.4239.0.

The default .codex directory was a junction to an existing directory on another drive, and the user-level CODEX_HOME variable was unset. Following the approach in this issue, we set the user-level CODEX_HOME to the existing physical target directory, retained the junction and data, and restarted Windows. Afterward, both the user and process environment reported the physical path. The documented CUA browser API connected to the existing NVIDIA careers tab and returned its title and accessibility content. No desktop-control fallback was used.

This is one successful test, not proof of the root cause or long-term stability. If trying the same approach, first verify the junction target and preserve the previous environment variable value so the change can be reverted. No personal paths, account details, conversation IDs, or logs are included in this comment.

Master-626 avatar Nov 07 '26 18:11 Master-626

Additional successful recovery: Windows Codex 26.1103.7773.0 (zh-CN) — both built-in Browser and native Computer Use recovered

I can confirm another successful recovery after explicitly setting CODEX_HOME to the physical directory behind a junction and rebooting Windows. In this installation, both the built-in browser connection and native Computer Use access to Chrome are now working.

Environment / observations

  • Windows UI locale: zh-CN
  • Codex Windows package: 26.1103.7773.0
  • Bundled Browser plugin directory: 26.1103.32239
  • Default %USERPROFILE%\.codex: a directory junction to an existing directory on another drive
  • CODEX_HOME: initially unset
  • Both scripts/browser-client.mjs and scripts/browser-service.mjs existed before the change
  • Before the change, Codex Desktop could not connect to its built-in browser. Native Computer Use also failed when trying to access Chrome, with the Windows browser-URL verification safety stop.

Change made

With the real target directory verified to exist, set the user-level environment variable to the physical target path, not the junction, using PowerShell:

[Environment]::SetEnvironmentVariable(
    "CODEX_HOME",
    "D:\path\to\actual\codex",
    "User"
)

Then performed a full Windows reboot and reopened Codex.

Results confirmed by the user

  • The built-in browser connection now works.
  • Native Computer Use can access Chrome again, resolving the earlier browser-control blocker in this environment.
  • No reinstall, plugin-cache deletion, data migration, or junction removal was needed.

This is a further before/after observation, not proof that junction resolution is the sole root cause or that the fix generalizes to every instance of the native Windows URL-verification error. Long-term reliability and complex-page behavior have not been systematically tested.

Thanks for documenting this workaround — it directly helped restore both browser paths on a newer Windows installation.

TTcc-812 avatar Nov 11 '26 07:11 TTcc-812

Windows confirmation on 2026-11-23: isolated TOML reproduction and restored Chrome interaction

Adding a reproducible data point, prepared with Codex assistance, to help users avoid repeated reinstalls.

Environment: Windows x64, French locale; desktop package OpenAI.Codex_26.1117.4957.0_x64__2p2nqsd0c76g0; browser runtime/plugin 26.1117.41037; Chrome extension 1.26.1117.11302.

Before: the default %USERPROFILE%\.codex was a directory junction to an existing physical directory on another drive. The browser directory and TOML file themselves were ordinary files/directories. The running service inherited the junction-based CODEX_HOME. Official agent.browsers.list() exposed only mcpapps; selecting Chrome failed. Native pipe transport succeeded, and an extension DevTools inspection showed a normal getInfo result. Runtime traces showed successful connections followed by handshake errors. The live error's underlying text was not exposed.

Controlled reproduction using the installed, unchanged node_repl runtime: a separate process and narrowly scoped test service read only a synthetic browser/config.toml containing probe_marker = true. The working directory stayed on a physical path. Comparing the same fixture through a physical CODEX_HOME and a junction produced:

CODEX_HOME Result
Physical fixture directory {"marker":true,"ok":true}
Junction to the same fixture (file identity verified) {"error":"Error: Codex TOML directory must not be a symlink","ok":false}

No browser accounts, real user configuration, installed-code patches, or sandbox-disabling flags were used in that isolated test. This tests an actual home-directory junction, unlike the separate workspace-cwd trigger in #60973.

Verified recovery: launched the desktop app with process-local CODEX_HOME pointing directly to the existing physical data directory, also using a physical startup directory. After a complete app restart (no Windows reboot), the effective service environment contained the physical path. Official discovery returned Chrome, IAB, and MCP Apps. Through the official extension-backed Chrome API, we opened a public application landing page, read its DOM, clicked its visible sign-in link, and confirmed both the destination URL and login-form DOM. No desktop-control fallback was used; temporary test tabs were closed.

The user-level CODEX_HOME value was subsequently persisted and Windows was notified. The ordinary-shortcut launch after that persistence has not yet been independently retested. The junction and all existing data were retained; no permission policy or security check was disabled. IAB discovery recovered, but IAB page interaction and long-term reliability were not tested.

Please expose configuration-read failures during discovery instead of reducing them to “Browser is not available”, document the physical-CODEX_HOME recovery path, and cover relocated Windows homes with regression tests while retaining the intended symlink protections.

No personal paths, account details, site URLs, session identifiers, credentials, screenshots, or raw trace files are attached.

CremaLab44 avatar Nov 23 '26 22:11 CremaLab44