Skip to content

In-app browser (IAB) backend never attaches to any Codex app thread; agent silently substitutes Playwright MCP #59417

Open

Description

@shauncathe

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

26.1029.61003 (build 24614, codex-cli 0.166.0-alpha.6); also reproduced on 26.1021.31345 (codex-cli 0.164.0-alpha.11.1)

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Darwin 27.2.0 arm64 arm

What issue are you seeing?

The in-app browser (IAB) backend never attaches to any Codex App thread. In every thread (project workspace thread bound to a folder, and plain new chats), agent.browsers.list() returns only the "Codex MCP Apps" (mcpapps) backend, and agent.browsers.get("iab") fails with "Browser is not available: iab" (error_code: browser_error from the browser plugin runtime).

The in-app browser itself works fine for manual use in the app side panel; only the per-thread agent attach is missing (the app never creates an iab-type backend pipe for these threads, so session-scoped discovery never finds IAB - discovery reason "no-iab-backends"/"no-session-match" in the plugin).

Secondary bug: with an explicit @browser mention and IAB unavailable, the agent silently substituted the standalone Playwright MCP server (playwright/browser_navigate, playwright/browser_snapshot) and presented it as success, contradicting the plugin rule: "If the user explicitly requests the in-app browser but it is unavailable, report that instead of substituting another browser."

What steps can reproduce the bug?

  1. Open any thread in the Codex Mac app (project thread or plain new chat), Browser Use setting enabled.
  2. Ask the agent to run: await agent.browsers.list() - result contains only [{"name":"Codex MCP Apps","type":"mcpapps"}].
  3. Ask the agent to run: await agent.browsers.get("iab") - fails with "Browser is not available: iab".
  4. Then say: "@browser open https://example.com and describe the page" - the agent silently uses Playwright MCP tools instead of the in-app browser and reports success.

What is the expected behavior?

The in-app browser should be discoverable via agent.browsers.get("iab") in App threads when Browser Use is enabled ("iab uses the current chat's tabs"). If a browser family is unavailable, the agent must report it instead of silently substituting another backend.

Additional information

  • Reproduced on two app versions: 26.1021.31345 (codex-cli 0.164.0-alpha.11.1) and 26.1029.61003 (0.166.0-alpha.6). Thread metadata: originator codex_work_desktop, source vscode.
  • The app never creates an iab backend pipe under /tmp/codex-browser-use for these threads; the mcpapps session pipe is created with a matching codexSessionId. Per the shipped plugin, iab/mcpapps backends are discoveryScope:"session" and require the pipe codexSessionId (and codexAppBuildFlavor) to match the current turn metadata.
  • Additional finding: after updating the app (26.1021 -> 26.1029), the bundled plugin cache (~/.codex/plugins/cache/openai-bundled/) still contained only old plugin versions and every browser setup call failed with "Cannot find module .../browser/26.1029.61003/scripts/browser-service.mjs". Fixed manually by extracting the installed app Resources/plugin-signatures/openai-bundled/*/plugin.tar.gz (sha256 verified against plugin.signature.json) into the versioned cache dirs. Suggest verifying/extracting bundled plugins into the versioned cache at launch or update time.

Activity

  1. added
    app
    on Nov 4, 2026
  2. added
    bug
    skills
    model-behavior
    on Nov 4, 2026
  3. shauncathe commented on Nov 4, 2026

    @shauncathe
    Author

    Update (same day): Not reproducible-fixed by the workaround suggested in #58535. I had the target chat selected and in the foreground (the browser side panel is available in that chat), and the agent still gets:

    await agent.browsers.get("iab")
    // => "Browser is not available: iab"  (error_code: browser_error)

    timestamp-verified repro today on 26.1029.61003 at 2026-11-04T14:39Z, from a resumed older thread (its trusted worker still loaded the 26.1021.31345 plugin — identical failure across both plugin runtimes).

    So at least on macOS 26.1029.61003, browser-sidebar-owner-sync → bindSessionRouteOwner running on chat selection does not make the IAB backend discoverable — consistent with the report in #58419 (visible IAB tab, still not bindable). This keeps the failure independent of panel state, selection state, plugin cache, and app version (26.1021 → 26.1029).

    Also noting both windows of agent.browsers.list() across all my tests contain only {"name":"Codex MCP Apps","type":"mcpapps"} — the app never creates an iab-type session pipe for any app thread (no-iab-backends), matching the session-scoped discovery analysis in the main report.

  4. shauncathe commented on Nov 6, 2026

    @shauncathe
    Author

    Update (2026-11-06): new-chat retest

    I retested today in a brand-new chat, which rules out a saved site denial carried over from an earlier chat, as well as chat selection and panel state. I opened the built-in browser with Cmd+Shift+B in the new chat and explicitly referenced it with @browser:

    • The in-app browser panel is visible in the new chat, and the page can be opened and viewed manually.
    • The agent still cannot control it: agent.browsers.get("iab") still fails with Browser is not available: iab.
    • In that test session, the agent's own reply was: "I couldn't read the in-app browser page: the browser connection rejected the request. There wasn't an open Page attached to your message either."

    So the symptom is precisely: the IAB page is visible, but no iab backend attaches to the thread, so browser control is unavailable. Starting a new chat does not fix it.

    App version used for this test: 26.1029.61003
    Platform: Darwin 27.2.0 arm64 arm

  5. shauncathe commented on Nov 7, 2026

    @shauncathe
    Author

    Update (2026-11-07): reinstall does not fix it

    For completeness: I have also fully uninstalled and reinstalled the desktop app, and the problem persists unchanged. The in-app browser page opens for manual use, but no iab backend attaches to any thread and agent control still fails with Browser is not available: iab.

    App version: 26.1029.61003
    Platform: Darwin 27.2.0 arm64 arm

  6. mainomega commented on Nov 18, 2026

    @mainomega

    Additional macOS reproduction (reported November 18, 2026) involving the in-app browser failing even in a brand-new Codex conversation and Codex switching to the user's personal Safari window.

    Steps reported

    1. Launch the Codex desktop app on macOS and start a new local conversation.
    2. Open the built-in browser in the right sidebar.
    3. Manually navigate to an authenticated administrative web application and sign in successfully in that built-in browser.
    4. Explicitly invoke @browser and ask Codex to work with the already-open, authenticated sidebar tab.
    5. Codex reports that it cannot use the in-app browser and instead opens/uses the user's separate, personal Safari browser window.

    Actual behavior

    The built-in browser visibly loads the site and maintains an authenticated session, but Codex cannot control that session even with an explicit @browser request. It switches to a browser outside the requested in-app browser, where the authenticated session is not the one the user prepared. This blocks the user's authorized workflow and risks interacting with the wrong browser profile.

    Expected behavior

    Codex should attach to and control the current conversation's visible in-app-browser tab, preserving its authenticated session. If the IAB backend is unavailable, it should report that failure clearly and must not silently substitute Safari or another browser.

    Troubleshooting / limitations

    • Selecting @browser and starting a new conversation have already been tried and did not resolve the issue.
    • Exact desktop build and literal underlying error text were not captured in this report; this is a firsthand user description, not an independent runtime/log inspection.
    • No credentials, site-specific admin data, or private URLs are included.

    Could maintainers confirm whether there is a known macOS fix or workaround for both the IAB attachment failure and the unexpected Safari fallback, and whether a release/milestone is planned?

  7. shauncathe commented on Nov 19, 2026

    @shauncathe
    Author

    Codex desktop: Browser is not available: iab — root cause and a working fix

    TL;DR — Two independent problems were stacked. (1) After an app upgrade, config.toml pointed at plugin cache version 26.1103.41825 while the cache only contained 26.1029.61003, so the trusted worker failed to import browser-service.mjs. (2) iab is a session-scoped, lazily registered backend: it only exists when the current chat owns a real in-app browser tab with a real page loaded. Fix the cache once, then create a tab + navigate in the same session every time. An app restart or a new chat resets it.

    Tested on macOS with the ChatGPT/Codex desktop app, build 26.1103.41825. All symbol names below are minified identifiers from that build and will differ in others.


    Symptom

    const { setupBrowserRuntime } = await import('<...>/browser/26.1103.41825/scripts/browser-client.mjs');
    const agent = await setupBrowserRuntime();
    
    await agent.browsers.list();
    // [{ id: "1", name: "Codex MCP Apps", type: "mcpapps",
    //    metadata: { codexSessionId: "<session-uuid>" } }]
    
    await agent.browsers.get("iab");
    // Error: Browser is not available: iab

    The in-app browser panel itself renders pages fine. Only the agent-side automation backend is missing — these are two separate layers, and confusing them cost me most of the debugging time.


    Root cause A: bundled plugin cache out of sync with the app build

    config.toml contained:

    NODE_REPL_TRUSTED_SERVICES = { "browser" = "~/.codex/plugins/cache/openai-bundled/browser/26.1103.41825/scripts/browser-service.mjs" }

    But ~/.codex/plugins/cache/openai-bundled/browser/ only had 26.1029.61003. After an app upgrade the config was regenerated against the new build, but the plugin cache was never re-extracted. chrome/latest still pointed to 26.1021.31345.

    Result, recorded repeatedly in thread_history_1.sqlite:

    Cannot find module '.../browser/26.1103.41825/scripts/browser-service.mjs'
    imported from .../trusted-worker.js
    

    This is a genuine bug worth fixing, but it is not why iab is absent. It only breaks the import. Control: in an earlier session with the cache intact and no import errors, browsers.list() already returned only mcpapps.

    Not the cause either: BROWSER_USE_AVAILABLE_BACKENDS=chrome,iab,mcpapps already includes iab, and [plugins."browser@openai-bundled"] enabled=true.

    Root cause B: iab is session-scoped and registered on demand

    From browser-service.mjs:

    Function Role
    Jle() enumerates /tmp/codex-browser-use/*.sock
    Wo.create() connects via globalThis.nodeRepl.nativePipe.createConnection() (privileged channel)
    Vx() sends getInfo over a 4-byte-LE-length-prefixed JSON-RPC frame
    Zle() filters by BROWSER_USE_AVAILABLE_BACKENDS
    Xle() keeps only backends whose metadata.codexSessionId === current runtime session id
    ace() reports no-iab-backends / no-session-match / missing-session-metadata when the count is 0

    Xle() marks iab and mcpapps as discoveryScope: "session"; extension and cdp are global. The bundled SKILL.md states it plainly:

    "The in-app browser is available only when the Browser skill is listed for the session" / "iab uses the current chat's tabs"

    So iab is not a daemon. The app creates a backend instance for a session only when that session owns a real in-app browser tab. mcpapps returning a correct codexSessionId proves session metadata works — there is simply no iab instance matching it.

    Socket signature (the most useful diagnostic):

    Permission Meaning
    srw------- (0600) iab backend
    srwxr-xr-x (0755) node_repl / trusted-worker

    A live 0600 socket appearing in /tmp/codex-browser-use/ is the moment the backend registers.


    The four conditions

    All four must hold simultaneously:

    1. Plugin cache version == app build version (fixes the Cannot find module errors)
    2. The chat mentions the Browser plugin (@Browser) so the skill is injected into the session
    3. That same chat owns a real in-app browser tab navigated to a real page ← the condition everyone misses
    4. The app creates a 0600 backend socket for that session (automatic once move all tests under tests/ #3 holds)

    Failing any one of them yields the identical, unhelpful Browser is not available: iab.


    Fix

    One-time: rehydrate the plugin cache

    APP=/Applications/ChatGPT.app/Contents/Resources/plugins/openai-bundled/plugins
    CACHE="$HOME/.codex/plugins/cache/openai-bundled"   # or "$CODEX_HOME/..."
    VER=26.1103.41825
    
    for p in browser chrome codex-app-tools unified-computer-use; do
      mkdir -p "$CACHE/$p/$VER"
      cp -a "$APP/$p/." "$CACHE/$p/$VER/"
    done
    ln -sfn "$CACHE/chrome/$VER" "$CACHE/chrome/latest"
    
    # verify: versions match and the service file is byte-identical to the signed bundle
    python3 -c "import json; print(json.load(open('$CACHE/browser/$VER/.codex-plugin/plugin.json'))['version'])"
    shasum -a 256 "$APP/browser/scripts/browser-service.mjs" \
                   "$CACHE/browser/$VER/scripts/browser-service.mjs"

    Then fully quit and relaunch the app — a running process does not re-read the plugin cache.

    Do not hand-edit config.toml or chrome-native-hosts-v2.json. They are app-managed and coupled; changing half of them makes things worse. There is also no Debug menu in this production build, so the official hint Debug > Plugins > Reload bundled plugins is not reachable.

    Per session: register the backend

    In the window that holds the target chat:

    View > Browser > New Tab
    View > Browser > Focus Browser Address Bar
    Cmd+A → paste the URL → Enter
    

    Then, in that same chat, mention @Browser and give a real browser task. Do not just paste a browsers.list() snippet — a bare snippet does not inject the skill.

    The URL must be pasted from the clipboard. Synthesizing keystrokes drops characters (https://example.com/ becomes https://example) and the address bar treats the fragment as a search query.

    Verify:

    import socket, glob, os
    for p in glob.glob('/tmp/codex-browser-use/*.sock'):
        if os.stat(p).st_mode & 0o777 != 0o600:
            continue
        s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM); s.settimeout(0.4)
        try:
            s.connect(p); print('LIVE iab backend:', os.path.basename(p))
        except OSError:
            pass
        finally:
            s.close()

    End-to-end confirmation: agent.browsers.list() now contains an entry with type: "iab".


    Why it keeps coming back

    iab is per-session. An app restart destroys every 0600 socket, and switching chats changes codexSessionId, so an existing socket no longer matches Xle().

    Observed directly: a backend socket created during a working session was gone after the next app restart (no crash report — a normal relaunch), and the following session again reported only mcpapps. A 0600 socket created later belonged to a different chat and was correctly filtered out.

    This is not a regression and there is no local config that makes iab persistent. Re-run the per-session trigger after every restart or chat switch. Patching the signed plugin code to relax the filter is not worth the risk.


    Debugging traps (each one cost real time)

    Trap Reality
    browser-sidebar-page-states.json shows no page for this chat → "no tab open" It is a snapshot written on quit, read on launch. Useless for live tab state.
    lsof <socket path> returns 0 listeners → "no backend" False negative for Unix sockets on macOS. Use an actual AF_UNIX.connect().
    Socket count unchanged after creating a tab → "trigger didn't work" The app recycles sockets. During page load it swaps 0600 sockets every few seconds; compare before/after socket identities, not counts.
    Stale 0600 files in /tmp/codex-browser-use/ Zombies return ECONNREFUSED and are skipped by discovery. Harmless; no need to clean.
    Probe the sockets from a standalone node_repl globalThis.nodeRepl.nativePipe is undefined outside the app. The privileged pipe is injected in-process only, so CLI probing cannot replace app-side registration.
    "The UI is broken" The panel rendered pages the whole time. UI rendering and agent backend discovery are different layers.
    "Unfixable app-side defect / server-side feature gate" Wrong — it worked as soon as condition #3 was satisfied.
    Feature flag, proxy, model, BROWSER_USE_BACKEND_PATHS All ruled out: env was AVAILABLE_BACKENDS=chrome,iab,mcpapps, FLAVOR=prod, TINYSKY_ENABLED=1, BACKEND_PATHS unset (default scan).

    Stable alternative: skip iab

    If the goal is just "let the agent open and operate a webpage", use the playwright MCP instead. It is not session-filtered; browser_tabs(list) and navigation both work reliably. In one failing session, the agent fell back to it automatically and opened the target site without any issue.

    Reserve iab for cases where you specifically need the app's own in-app browser tabs.


    Automation

    Minimal reproducible helper (clipboard-safe, English menu names — add a localized fallback if your UI is not English):

    #!/usr/bin/env bash
    set -euo pipefail
    URL="${1:-https://example.com/}"
    CLIP=$(mktemp); pbpaste > "$CLIP" || true
    printf '%s' "$URL" | pbcopy
    
    osascript <<'AS'
    tell application "ChatGPT" to activate
    delay 1
    tell application "System Events"
      tell process "ChatGPT"
        set frontmost to true
        click menu item "New Tab" of menu 1 of menu item "Browser" of menu 1 of menu bar item "View" of menu bar 1
        delay 0.8
        click menu item "Focus Browser Address Bar" of menu 1 of menu item "Browser" of menu 1 of menu bar item "View" of menu bar 1
        delay 0.8
        keystroke "a" using command down
        delay 0.2
        keystroke "v" using command down
        delay 0.6
        key code 36
      end tell
    end tell
    AS
    
    cat "$CLIP" | pbcopy || true; rm -f "$CLIP"

    Requires Accessibility permission for the calling process (System Events menu clicks). A reusable wrapper can add localized menu fallback, before/after socket verification, and a read-only --check mode.


    Known open items

    • chrome-native-hosts-v2.json still reports 26.1021.31345 / proxyPort: 0 / pid: 0 after a relaunch. It affects the chrome extension backend only, not iab. Left untouched intentionally.
    • Leftover dead 0600 socket files are harmless.
    • Site health was verified independently (HTTP/2 and HTTP/1.1 both fine, no 5xx), so this was never a network or server problem.

    Rollback: delete the four added 26.1103.41825 cache directories and repoint chrome/latest to its previous target. config.toml and chrome-native-hosts-v2.json were never modified.


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

    appbrowserbugmodel-behaviorskills

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions