Skip to content

Daemon bootstrap reports success while its updater exits with SUN_LEN under a deep CODEX_HOME (Linux) #51153

Closed

Description

@CheckPickerUpper

Behaviour

On Linux with codex-cli 0.160.0, app-server daemon bootstrap successfully starts the managed app-server and records a daemon-updater PID, but the updater immediately exits when its Unix socket path exceeds the platform address limit. Its stderr contains Error: path must be shorter than SUN_LEN, and daemon-updater.sock never appears. The serving daemon survives, so an immediate PID-file check can incorrectly suggest that auto-update is working.

Observed in a private HOME under a pytest directory on 2026-10-03. No production daemon was stopped or restarted. The fixture's updater socket was longer than Linux's 108-byte Unix-address field. A short private HOME under disk TMPDIR produces a 99-byte updater address and is the proposed fixture workaround.

Source

The updater binds its manual-update listener directly to manual_update_socket_path() in update_loop.rs:118–128.

That path is the updater PID-file path with a .sock extension, with no short-address mapping, in lib.rs:993–995.

The existing deep control-socket path report describes daemon-client control addresses in 0.137/0.139 on macOS. This reproduction concerns the updater's separate socket in 0.160.0 on Linux; the app-server control socket itself works through its existing long-path fallback.

Reproduction

  1. Create a private HOME on disk with a long absolute path. Set CODEX_HOME to its .codex directory. Choose the length so $CODEX_HOME/app-server-daemon/daemon-updater.sock exceeds 108 bytes.

  2. Copy the installed 0.160.0 app-server release into that private home's packages/app-server-daemon/releases/0.160.0-x86_64-unknown-linux-musl, create current pointing at that release, and write that release name without a newline to auto-update-version. Never share writable package files or lifecycle state with the real HOME.

  3. In the private app-server-daemon/settings.json, enable automatic updates and set shutdown grace to zero. Use a private config and no credentials.

  4. Run the private binary with HOME, CODEX_HOME and TMPDIR explicitly set to private paths:

    "$private_codex" app-server daemon bootstrap
  5. After bootstrap succeeds, read app-server-daemon/daemon-updater.pid, inspect that process, the updater socket, and daemon-updater.stderr.log.

Observed: the updater exits, the socket is absent, and stderr reports SUN_LEN; the daemon accepts a turn. Shortening only the private HOME makes the updater address fit. Stop only the private daemon and updater when finished.

Expected

The updater should use a private short-address mapping for long paths, consistently with app-server control sockets. Bootstrap should not report a working updater merely because its PID record was published before startup failed. A regression should verify the updater stays alive and serves its socket after bootstrap with a long CODEX_HOME.

Environment: codex-cli 0.160.0 (npm, linux-x64 musl), Ubuntu, managed app-server daemon.

Activity

  1. added
    bug
    CLI
    app-server
    on Oct 5, 2026
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-serverbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions