Skip to content

CLI account/read workspace routing fails by default but succeeds with unrelated -c overrides (0.156.1–0.162.1) #52928

Open

Description

@Baifeng76

Summary

With a working proxy and a valid ChatGPT login, plain codex fails immediately during TUI bootstrap:

Error: account/read failed during TUI bootstrap: account/read failed: workspace routing discovery failed (code -32603)

Passing an apparently unrelated CLI config override makes startup and model interaction succeed:

codex -c 'log_dir="/tmp/codex-test-log"'
# also works:
codex -c 'model_reasoning_effort="medium"'

Setting log_dir at the top level of config.toml does not fix it, and temporarily removing config.toml entirely still fails. Reproduced on 0.156.1 and after upgrading to 0.162.1.

This seems closely related to #48600 and #49827; this report adds controlled proxy-protocol and configuration-source comparisons.

Environment

  • Ubuntu 22.04 LTS in a headless Docker container, x86_64
  • Codex standalone CLI 0.156.1 and 0.162.1
  • ChatGPT account authentication (reauthentication attempted)
  • Proxy required for network access; Ninja Desktop Lite using Ninja 2.0 subscription
  • Local listening endpoints: HTTP 127.0.0.1:7899, mixed 127.0.0.1:7897, SOCKS5 127.0.0.1:7898
  • No TUN

Controlled reproductions

Proxy environment Invocation Result
HTTP-only HTTP_PROXY/HTTPS_PROXY port 7899, ALL_PROXY unset codex Fails in account/read
SOCKS5-only ALL_PROXY=socks5h://127.0.0.1:7898, HTTP proxy vars unset codex Fails
HTTP-only port 7899 codex -c 'log_dir="/tmp/codex-test-log"' Works, including model reply
Mixed HTTP proxy port 7897 codex Fails
Mixed HTTP proxy port 7897 codex -c 'log_dir="/tmp/codex-test-log"' Works
Valid proxy enabled codex -c 'model_reasoning_effort="medium"' Works, model interaction completes
No proxy codex -c 'log_dir="/tmp/codex-test-log"' Fails

The default failure was timed at 1.630 seconds (time codex), which is not consistent with a 15-second timeout being exhausted.

The proxy itself is verified: Git/Python/curl HTTPS work, and a proxied unauthenticated GET to https://chatgpt.com/backend-api/codex/responses reaches the endpoint and returns HTTP 405 with Allow: POST. The working -c invocation completes authenticated model calls.

Configuration-source comparison

  • log_dir = "/home/rmh/.codex/log" is confirmed by Python tomllib to be a top-level key in ~/.codex/config.toml.
  • Plain codex still fails with that setting.
  • codex -c 'log_dir="/home/rmh/.codex/log"' succeeds, although it specifies the same path.
  • codex -c 'log_dir="/tmp/codex-test-log"' also succeeds.
  • Temporarily moving config.toml away and launching plain codex still fails. The configuration was preserved and restored.

History commands

  • Plain codex resume --all fails during bootstrap.
  • codex -c 'log_dir="/tmp/codex-test-log"' resume --all successfully lists existing local sessions.
  • codex agents also showed account/read discovery errors in prior tests.

Expected

A working ChatGPT-authenticated CLI behind a working HTTP/SOCKS5 proxy should initialize without requiring an unrelated -c configuration override. Passing the same effective log_dir via config file vs command line should not affect account routing discovery.

Actual

The default startup path fails during account/read, while two unrelated CLI overrides allow normal operation with the built-in openai provider.

Questions

  1. Does the presence of CLI -c overrides change how config layers, proxy settings, or workspace-routing discovery are initialized?
  2. Is there a way to expose the underlying HTTP/transport error behind the generic workspace routing discovery failed message?
  3. Can this behavior be fixed without requiring a CLI-only workaround?

Workaround

With the proxy enabled:

codex -c 'log_dir="/tmp/codex-test-log"'

This is reproducible but does not explain the failure mechanism. No tokens, subscription URLs, or private session contents are included here.

Activity

  1. added
    bug
    CLI
    app-server
    connectivity
    on Oct 10, 2026
  2. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. Baifeng76 commented on Oct 10, 2026

    @Baifeng76
    Author

    Follow-up: --no-daemon works — likely shared background server path

    I found a much more direct reproducer and workaround:

    With the same shell, proxy environment, authentication, and configuration, running:

    codex

    fails in ~1.63 seconds with account/read failed: workspace routing discovery failed (code -32603), but

    codex --no-daemon

    successfully starts and works normally, without needing any -c configuration override.

    I also see the following message when launching with -c:

    Running without the shared background server: command-line configuration overrides (-c, --enable, --disable, or --search) requires embedded mode.
    

    This appears to explain the previously surprising observation that both -c log_dir=... and -c model_reasoning_effort=... work: those arguments select embedded mode rather than using the shared background server. The issue is therefore likely specific to the shared background server / daemon account-read or workspace-routing path, rather than to either configuration value itself. I have not identified the underlying server-side or network-level cause.

    Current clean workaround:

    # With the working proxy already configured:
    codex --no-daemon

    This is preferable to the unrelated -c log_dir override. Please investigate why account/read fails via the shared background server but succeeds in embedded mode.

  4. vasilbekk commented on Oct 12, 2026

    @vasilbekk

    +1

  5. wenzhaoabc commented on Oct 12, 2026

    @wenzhaoabc

    I also meet this bug. But I add a .env file in ~/.codex and restart codex, and it works.

    http_proxy="http://127.0.0.1:10808"
    https_proxy="http://127.0.0.1:10808"
    NO_PROXY=localhost,127.0.0.1,::1
    no_proxy=localhost,127.0.0.1,::1
  6. prashan-s commented on Oct 14, 2026

    @prashan-s

    Also not working for

    ❯ codex --yolo
    Error: account/read failed during TUI bootstrap: account/read failed: failed to load workspace requirements (code -32603)

  7. ziheng5 commented on Oct 15, 2026

    @ziheng5

    Environment

    • Arch Linux x86_64
    • Codex version 0.162.1
    • Codex App Server Version 0.160.0(It seems to be the crux of the matter.)

    Summary

    When running codex --no-daemon or codex -c "xxx", Codex launches in "Embedded Mode" without any issues. This suggests that the problem likely lies with the shared background server used by Codex by default—a situation similar to the issue described in Issue #41188.

    My local version of Codex is 0.162.1. Upon running the command below in the terminal, the output showed "appServerVersion":"0.160.0":

    codex app-server daemon version

    This indicates the mismatch between the version of the background service and the actual version of the Codex application.

    The background service was updated to version 0.162.1, bringing it in line with the application version after executing the command below:

    codex app-server daemon update --from-cli --yes

    Following this, I tried running codex directly from the command line again, and it launched successfully!

    It appears to be a flaw in the codex's own update strategy: when the codex is updated, the corresponding update for the App Server version is overlooked, leading to a version mismatch that causes startup failure. 🤔

  8. bboygun commented on Oct 15, 2026

    @bboygun

    Workaround: Restarting the daemon fixed the issue (no version mismatch)

    I encountered the same issue on Linux with Codex CLI 0.162.1, using an HTTP proxy.

    Symptoms:

    • Running codex failed with:
      Error: account/read failed during TUI bootstrap:
      account/read failed: workspace routing discovery timed out (code -32603)
      
    • codex login status showed Logged in using ChatGPT.
    • The proxy was working correctly. A curl request to https://chatgpt.com/backend-api/wham/accounts/check returned HTTP 401 (expected without authentication) in approximately 0.46 seconds.
    • codex --no-daemon worked normally.

    Daemon version check:

    I ran:

    codex app-server daemon version

    The output confirmed that all versions matched:

    {
      "status": "running",
      "backend": "pid",
      "managedCodexVersion": "0.162.1",
      "cliVersion": "0.162.1",
      "appServerVersion": "0.162.1"
    }

    Solution:

    Simply restarting the daemon resolved the issue:

    codex app-server daemon restart

    After the restart, running codex directly worked again without --no-daemon or any configuration overrides.

    Observation:

    Unlike the previously reported version mismatch, my CLI and App Server were already on the same version (0.162.1).

    This suggests that the issue may also be related to stale daemon state, inherited proxy environment variables, or connection state within the long-running daemon process.

    I haven't identified the exact root cause, but restarting the daemon was sufficient to restore normal functionality.

  9. Tohrusky commented on Oct 15, 2026

    @Tohrusky

    thanks

  10. Baifeng76 commented on Oct 20, 2026

    @Baifeng76
    Author

    6. I also meet this bug. But I add a .env file in ~/.codex and restart codex, and it works.
    http_proxy="http://127.0.0.1:10808"
    https_proxy="http://127.0.0.1:10808"
    NO_PROXY=localhost,127.0.0.1,::1
    no_proxy=localhost,127.0.0.1,::1

    This also works for me, thanks!

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

    CLIapp-serverbugconnectivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions