Skip to content

Managed daemon auto-update restart kills in-flight turns without a terminal event and reloads threads with default permissions instead of Full access (0.160.0 → 0.160.1, macOS) #51201

Closed

Description

@adilwali

What happened

macOS (arm64), managed app-server daemon with its own CODEX_HOME, several long-running desktop-app threads set to Full access (permission_profile type disabled, approval never).

  1. The daemon's update loop installed 0.160.1 over 0.160.0, and a minute later restarted the app-server.
  2. Four threads had turns in progress. Each of those turns simply stops in its rollout: no task_complete, no turn_aborted, no error event. Nothing tells the thread (or the user) the turn was killed.
  3. The restarted app-server emitted thread_settings_applied for each thread with permission_profile type managed and a restricted filesystem (workspace and tmp writable, no network), instead of the disabled profile the threads had before the restart.
  4. The next turn on such a thread (started with codex queue --thread …) ran under that sandbox: no network, .git not writable. The agent could not reach anything outside the machine, including to ask for help. Nothing in the thread showed that its permissions had changed.

Expected

  • A daemon update does not restart the app-server under running turns (drain or hand off first), or at minimum records a terminal event with a reason on each interrupted turn.
  • A thread's permission settings survive an app-server restart; a reloaded thread keeps the permissions it had.

Workaround

Over the daemon's control socket, turn/start with sandboxPolicy: {type: "dangerFullAccess"} and approvalPolicy: "never" restores the previous behavior for that turn and subsequent turns.

Versions

codex-cli 0.160.1, app-server 0.160.1 (updated from 0.160.0 by the managed daemon), macOS 26.6.2 arm64.

Related

#45665 (turn lost when the app-server is replaced), #51098 (--yolo ignored on the managed daemon), #48195 (self-updating daemon as the default).

Activity

  1. added
    bug
    app
    app-server
    sandbox
    on Oct 5, 2026
  2. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor
  3. junaga commented on Oct 7, 2026

    @junaga

    Additional observed case on Linux during an active CLI realtime voice conversation.

    Environment:

    • Debian 13, x86_64, kernel 6.12.111+deb13-amd64.
    • Running TUI: npm Codex CLI 0.160.1, launched with codex --yolo (confirmed from the still-running process arguments).
    • Replacement managed app-server reports 0.161.0. The rollout's original CLI version is 0.160.1.

    Sanitized timeline (UTC, 2026-10-07):

    • 22:43:53 through 22:48:42: saved turn contexts have approval_policy=never, sandbox_policy.type=danger-full-access, and permission_profile.type=disabled.
    • 22:47:32: realtime voice starts; the first two voice turns retain full access.
    • 22:48:55: app-server logs a thread/resume request from codex-tui client 0.160.1. The same resume/session initialization logs use server version 0.161.0.
    • 22:49:51: the next voice turn's saved context switches to approval_policy=never, sandbox_policy.type=workspace-write, network_access=false, and a managed restricted permission profile. Workspace/temp remain writable.
    • pactl commands which had succeeded earlier now fail with pa_write() ... Operation not permitted and pa_context_connect() ... Connection refused.
    • 22:51:50: choosing /permissions Full access produces a logged ThreadSettings override with approval_policy=Never, permission_profile=Disabled, and active_permission_profile.id=:danger-full-access.
    • 22:52:33: after stopping voice and sending a typed message, the next saved turn returns to never + danger-full-access + disabled; pactl succeeds again. A restarted voice session also retains working audio access.

    This confirms an effective permission downgrade in the existing --yolo CLI thread following a managed-server resume. It does not establish that voice caused the downgrade: voice initially worked, and the version-changing resume is the stronger diagnostic lead. Likewise, the permission change taking effect on the next typed turn may simply reflect the still-running voice backend turn rather than a separate voice bug.

    Expected: an existing thread's explicit full-access settings survive daemon replacement/reconnect. No daemon restart or configuration change was performed as part of this investigation. Raw logs, audio, task contents, usernames, local paths, and session IDs are omitted.

    Further investigation of the reconnect trigger:

    Together these observations strongly point to an automatic local daemon upgrade from 0.160.1 to 0.161.0 as the reconnect trigger. No evidence of an internet outage was found in that window. The permission loss occurs after reload/resume; the evidence does not implicate voice as the cause.

  4. etraut-openai commented on Oct 11, 2026

    @etraut-openai
    Contributor

    Thanks for the detailed report. There are two separate issues here:

    1. Turns interrupted during an update: This is expected behavior. The daemon first gives active turns time to drain, then forces the restart after 60 seconds by default. A forced shutdown can cut off turns before they record a terminal event. You can increase the wait by setting shutdownGraceSeconds in the daemon’s CODEX_HOME/app-server-daemon/settings.json; it accepts values up to 300 seconds. Canceled turns are restarted automatically after the server update.

    2. Permissions reverting after restart: This is a bug. Threads should retain their explicit Full access settings when reloaded. A fix is already in place and will ship in an upcoming release, likely 0.163.0 or 0.164.0. The exact release isn’t confirmed yet.

    Sorry for the disruption, and thanks for helping identify the permissions issue.

  5. adilwali commented on Oct 11, 2026

    @adilwali
    Author

    Thanks for getting this fixed so quickly!

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-serverbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions