Skip to content

Codex Desktop remote proxy respawns unmanaged app-server and blocks daemon bootstrap #24542

Description

@pwh9882

Summary

When a Mac Codex Desktop remote connection is active, it appears to keep a non-interactive SSH session open on the remote host and run codex app-server proxy. During migration to standalone managed daemon mode, killing codex app-server --listen unix:// is ineffective because the proxy immediately respawns an unmanaged app-server.

This causes:

codex app-server daemon bootstrap --remote-control
Error: app server is running but is not managed by codex app-server daemon

Environment

  • Remote host: Linux over SSH
  • Codex CLI: 0.133.0
  • Client: Mac Codex Desktop remote connection
  • Managed path after successful bootstrap: ~/.codex/packages/standalone/current/codex

Context

I ran into this while trying to make the same remote server available from a phone. The remote server was not showing up as expected from the phone, so I tried to start or repair remote control on the SSH host.

That led to an error around the existing app-server state. I then tried to migrate the host to the standalone managed daemon flow, but even after disabling the old codex-remote-control.service and killing codex app-server --listen unix://, an unmanaged app-server kept coming back and continued to block codex app-server daemon bootstrap --remote-control.

The surprising part was that the respawn source was not the old systemd service. It was a Codex Desktop-created SSH notty session that was still running codex app-server proxy.

Observed process tree

sshd: user@notty
  `- /bin/sh -c ... codex app-server proxy
      `- codex app-server proxy

codex app-server --listen unix://

The unmanaged app-server kept owning:

~/.codex/app-server-control/app-server-control.sock

Killing only codex app-server --listen unix:// caused it to reappear.

Workaround

Terminate the stale SSH notty session that owns the proxy, then run:

codex app-server daemon bootstrap --remote-control

After that, the expected managed processes are:

~/.codex/packages/standalone/current/codex app-server --remote-control --listen unix://
~/.codex/packages/standalone/current/codex app-server daemon pid-update-loop

Expected behavior

One or more of:

  • codex app-server daemon bootstrap --remote-control should report the PID and parent process that is keeping the unmanaged app-server alive.
  • The Desktop remote proxy should detect an existing managed daemon and attach to it instead of respawning an unmanaged app-server.
  • There should be a clear command to disconnect or stop Desktop-created remote proxies on the remote host.
  • The error message should mention that an active codex app-server proxy or SSH notty session may be the respawn source.

Actual behavior

The bootstrap command only reports:

Error: app server is running but is not managed by codex app-server daemon

The unmanaged server may be immediately recreated by the Desktop proxy, making normal kill or disable steps appear ineffective.

Possibly related

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingremote

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions