Skip to content

macOS Desktop: local app-server exit 127 is reported as an organization/network settings failure #48481

Open

Description

@GH-Mason

Summary

On macOS, an existing executable selected by CODEX_CLI_PATH exited with code 127 before starting the Codex app-server. Desktop then displayed the blocking "Organization settings could not be loaded" dialog with network, proxy, firewall, and account troubleshooting suggestions. The dialog did not expose the local process failure or the active CLI override, which made the actionable cause difficult to identify.

The immediate cause was a custom local wrapper with an outdated assumption about the bundled CLI location. This report concerns the desktop error message and diagnostics for that failure, not a request to preserve private application-bundle paths.

Environment

  • OS: macOS.
  • Desktop version: 26.924.22138 (build 11645).
  • Bundle identifier: com.openai.codex.
  • Installed application bundle name: ChatGPT.app.
  • Bundled CLI version: 0.158.0-alpha.2.1.
  • An executable wrapper was selected through CODEX_CLI_PATH in the GUI launch environment.

Observed incident and verified checks

The blocking organization-settings dialog appeared after an application update. Retry returned to the same failure. The dialog offered Retry, Sign out, and Quit.

Local diagnostic requests independently reproduced the backend failure without deliberately breaking or restarting the working GUI:

Backend selected Result for the same initialization/configuration-read sequence
Bundled CLI invoked directly configRequirements/read succeeded with requirements: null
Custom wrapper invoked as the backend Process exited with code 127; stderr: Codex proxy could not find the bundled CLI

The custom wrapper searched for a now-absent bundle-relative executable, Contents/Resources/codex. The installed executable was present at Contents/Resources/codex-cli/CodexCLI.app/Contents/MacOS/codex.

Inspection of this installed build's startup code showed that the early organization-settings check maps an app-server launch/initialization failure on the path to configRequirements/read to the generic dialog. The Sign out path also depends on the same backend being available. That code path explains why Sign out cannot complete when the backend cannot start; the follow-up investigation did not trigger another live GUI sign-out attempt. Quit closes the application.

The examined early-startup path uses an in-memory logging buffer and records the startup failure before the normal application bootstrap. Quitting at this point can discard that buffered diagnostic. This code observation does not establish that every other logging channel is empty.

After updating the local wrapper's path resolution, the same initialization/configuration-read sequence succeeded through the wrapper as well. The application's organization-policy check was not bypassed.

Expected behavior

Keep the organization-policy check enforced, but distinguish a local backend launch/initialization failure from a network failure or a returned organization policy.

For this case, show an actionable message such as:

The local Codex backend exited before organization settings could be read (exit code 127). A custom CODEX_CLI_PATH override is active. Check that executable and its dependencies, then retry.

Provide a local diagnostic detail or copyable error containing the selected backend source, exit status, and a bounded stderr excerpt. Persist a sanitized startup diagnostic so quitting the dialog does not remove the useful failure detail. Explain when Sign out cannot complete because the backend is unavailable.

Automatic silent fallback from an explicit custom CLI override is not required by this report. Any recovery path must still perform the normal organization-policy check successfully.

Suggested minimal reproduction for maintainers

These are proposed controlled reproduction steps, not a second GUI reproduction performed on the reporting user's machine:

  1. In an isolated macOS test environment, create an executable backend stub that writes a fixed non-sensitive diagnostic to stderr and exits with status 127.
  2. Launch a fresh desktop process with CODEX_CLI_PATH set to that existing executable for that process only.
  3. Observe the startup dialog, the available local diagnostics, and whether Retry and Sign out communicate the backend failure accurately.
  4. Launch a clean process without the override and compare the startup result.

The stub does not need to implement the app-server protocol, because the reported failure happens before protocol initialization. Avoid setting a persistent GUI environment variable on a normal working account for this test.

Related report

#28474 describes a Windows browser-policy error masking a missing local CLI path. It is relevant as a similar error-classification problem, but its platform, feature, and trigger differ from this macOS startup case. The targeted search did not establish an exact duplicate of this report.

No conversation transcript, personal filesystem path, credentials, or raw log attachment is included.

Activity

  1. added
    bug
    app
    app-server
    on Sep 26, 2026
  2. furkancak1r commented on Sep 28, 2026

    @furkancak1r

    Same symptom on 11645, but with no CODEX_CLI_PATH override — the bundled CLI is never spawned

    Reporting a variant of this issue that the current diagnosis does not explain. Same version, same blocking dialog, but the local backend is never launched at all, so there is no exit-127 wrapper to fix.

    Environment

    • macOS 26.6.2, arm64
    • Desktop 26.924.22138 (build 11645), bundle id com.openai.codex, bundle name ChatGPT.app
    • Bundled CLI 0.158.0-alpha.2.1 at Contents/Resources/codex-cli/CodexCLI.app/Contents/MacOS/codex
    • No custom launcher of any kind (see checks below)

    1. No override is configured

    • launchctl getenv CODEX_CLI_PATH → empty
    • CODEX_CLI_PATH absent from ~/.zshrc, ~/.zprofile, ~/.zshenv, ~/.bash_profile, ~/.bashrc, ~/.profile
    • codex_cli_command / codex_cli_path absent from ~/.codex/config.toml and ~/.codex/.codex-global-state.json

    The backend selection therefore falls through to the bundled path, which exists and is executable.

    2. The bundled CLI works when invoked directly

    Using the exact handshake the desktop app sends (clientInfo: codex_desktop, capabilities: { experimentalApi: true }), then initialized, then:

    configRequirements/read  ->  {"requirements": null}
    

    Reproduced over plain stdio and through app-server proxy on the control socket. The control socket also completes a normal WebSocket upgrade (101 Switching Protocols).

    3. Policy validation cannot be the blocker

    Given {requirements: null}, the startup validator resolves to unrestricted and returns without throwing. So the failure occurs strictly before validation, in the app-server read itself. Supplying or changing a policy value cannot affect this case.

    4. The app never spawns the app-server

    Across four launches, polling for 60s each: zero codex child processes, and 0 bytes of application-level log on stdout/stderr. Enabling Electron logging produces only Chromium-internal lines.

    For comparison, the immediately previous build 26.924.20706 (build 11431) on the same machine logs:

    [StdioConnection] stdio_transport_spawned executablePath=.../CodexCLI.app/Contents/MacOS/codex
    [window-manager] window ready-to-show appearance=primary startupElapsedMs=500
    

    and reports zero Desktop startup policy read failed entries. Rolling back one build is the current workaround.

    This also independently confirms the in-memory-log-buffer concern raised above: on 11645 the buffered startup diagnostic is never flushed, so quitting the dialog destroys the only copy.

    5. Everything else verified healthy on 11645

    • codesign --verify --deep --strict → exit 0, including the nested CodexCLI.app (notarized, ticket stapled, Team ID 2DC432GLL2)
    • Not MDM-managed: no enrollment, no configuration profiles
    • /etc/codex/managed_config.toml absent; no forced managed preference for com.openai.codex key requirements_toml_base64
    • configRequirements/read returns requirements: null, i.e. correctly unrestricted
    • Valid appcast, app already on the newest published build

    6. Not network-dependent

    Reproduced on two unrelated networks (home connection and phone hotspot). In the same session the Rust app-server client receives 200 OK from chatgpt.com/backend-api/..., so connectivity is not the differentiator.

    Requested

    If the app-server never spawns, the dialog should say so instead of implying an organization or network restriction — the current wording sends people toward proxy/firewall/VPN troubleshooting, and in this case toward signing out of a workspace that was never the problem. Surfacing the resolved backend path plus the launch error (even ENOENT/EACCES/immediate exit) would have made this diagnosable in minutes.

  3. jeffsutton-hlx commented on Oct 15, 2026

    @jeffsutton-hlx

    Any updates on this issue? We also tried the instructions for clearing CODEX_CLI_PATH and it's still not working. Most users can use the app but a handful have this problem.

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

    appapp-serverbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions