Skip to content

Allow Codex Desktop to connect to an externally managed App Server #40134

Open

Description

@gxthrj

What variant of Codex are you using?

App

What feature would you like to see?

Codex App Server already supports stdio, WebSocket, and Unix socket transports, and the Codex CLI can connect to an existing App Server with codex --remote. Codex Desktop does not appear to provide a documented way to connect to an externally managed App Server.

Please allow Codex Desktop to connect to an existing App Server endpoint at startup, for example:

open -a Codex --args --remote unix:///path/to/codex-app-server.sock

or:

open -a Codex --args --remote ws://127.0.0.1:4500

A persistent setting such as desktop.app_server_endpoint would also be useful.

Required behavior:

  1. Desktop and another trusted local client can connect to the same App Server.
  2. Threads created by either client appear immediately in Desktop.
  3. Both clients receive thread and turn notifications.
  4. Desktop can navigate directly to externally created threads.
  5. Either client can append turns to an idle thread.
  6. Active-writer and approval ownership are explicitly defined.
  7. Disconnecting one client does not leave a lock that blocks the other.
  8. Local WebSocket and Unix socket connections support capability-token authentication.
  9. Existing codex://threads/<thread-id> navigation works for externally created threads.

The App Server must support multiple collaborating clients, not merely multiple transport connections.

Additional information

Related issues document narrower symptoms of the current split-process approach:

This request is broader than those bugs: it asks for a supported Desktop startup/configuration mode that connects Desktop and trusted local integrations to the same App Server instance, with explicit multi-client lifecycle and ownership semantics.

Official App Server documentation: https://learn.chatgpt.com/docs/app-server

Activity

  1. added
    enhancement
    app
    app-server
    on Aug 22, 2026
  2. SIMON-WORLD commented on Sep 3, 2026

    @SIMON-WORLD

    Concrete production use case for this request from a trusted local orchestration integration.

    I currently have a working flow roughly like:

    ChatGPT-side orchestrator
    → authenticated local tunnel/control plane
    → local orchestration service
    → independently managed codex app-server
    → Codex
    

    The external App Server path itself works well for sustained execution. In a recent Windows production test, a thread created this way ran for roughly 16 minutes, modified files, ran tests, committed and pushed its work, and remained durably readable through App Server afterward.

    The operational gap was human visibility: because the orchestrator and Codex Desktop were attached to separate App Server processes, the successfully created thread was not live-registered in the already-running Desktop sidebar. That is the same core failure mode tracked in #36363, now reproduced in a real Windows orchestration workload rather than a short synthetic thread.

    For this use case, returning to UI automation is not desirable. The App Server protocol is already the appropriate execution boundary; what is missing is a supported way for Desktop and a trusted local controller to participate in the same authoritative server/session plane.

    Current upstream work appears to make this direction even more relevant:

    • App Server already broadcasts thread lifecycle notifications such as thread/started to connections of the running server.
    • The local Unix-socket control transport is supported on Windows.
    • The new managed App Server daemon now supports Windows as well (Support the app-server daemon on Windows #42405), providing infrastructure for sharing a background App Server across Codex sessions.

    I do not assume that this means Desktop can already attach to an externally managed daemon; that is still the capability requested by this issue.

    One additional distinction may be important for the eventual contract: sharing the App Server appears to solve only part of the problem. #40935 reports that a custom client connected to the exact App Server process used by Desktop can create a task that is immediately visible/openable in Desktop, while the App Server projectId and Desktop saved-project assignment still remain separate.

    So the desired end state for an external orchestrator would ideally include two explicit contracts:

    1. one shared App Server lifecycle/notification plane for thread creation, turns, writer ownership, approvals, and reconnect; and
    2. a supported Desktop project/catalog mapping contract, rather than requiring external clients to infer or mutate Desktop-private project state.

    For our integration, the important properties would be deterministic thread identity, immediate Desktop visibility, explicit active-writer/approval ownership, reconnect without duplicate execution, and no direct access to Desktop databases or UI automation.

    I can provide a sanitized sequence diagram and App Server request/notification timeline from the production reproduction if useful.

  3. yvettehuang199212-sketch commented on Oct 9, 2026

    @yvettehuang199212-sketch

    我们需要一个运行在同一台 Windows 电脑上的受限桥接程序,将输入提交给 Codex Desktop 已有线程,不创建替代线程。
    请确认当前受支持的接入方式及最低版本:

    1. 如何连接桌面实际使用的同一个 App Server,并完成受支持的认证?
    2. 如何在服务端保证忙碌时排队或明确拒绝,而不向当前运行追加输入?
    3. 哪个接口返回单条提交的接纳编号?请求超时后如何查询接纳状态、避免重复执行?
    4. 如何保留原线程的沙箱、工具审批及权限设置?
      如果 Windows 桌面暂不支持,请明确说明。本文不附会话、凭证、业务材料或私有标识。

    关联:#41014

  4. dwyler741 commented on Oct 12, 2026

    @dwyler741

    Could maintainers clarify the currently supported external-client contract for macOS Codex Desktop using app-server 0.162.0-alpha.17.2?

    The integration needs an external UI to use Desktop's actual host and persistent conversation, including its authorized tools and question, approval, and result callbacks. The official app-server documentation describes transports, but does not establish how an external client binds to the already-running Desktop host.

    1. What documented endpoint and client-registration mechanism provides that binding?
    2. Can Desktop and the external client share the same persistent thread and callbacks, with defined active-writer and approval ownership?
    3. If this connection is not currently exposed, what recommended integration pattern and minimum version preserve Desktop capabilities and persistent reopening?

    Please point to the public contract or documentation. No credentials, private session identifiers, user content, or logs are attached.

  5. wang491086145-cmyk commented on Oct 22, 2026

    @wang491086145-cmyk

    Request: Official integration contract for ChatGPT Web → Codex Desktop active sessions

    We are developing a ChatGPT Web plugin that needs to interact with the official Codex Desktop application on macOS, not a separate headless Codex CLI or independently launched App Server.

    Our required workflow is:

    ChatGPT Web → Local Bridge → User-selected active Codex Desktop thread → Live execution visible in Codex Desktop → Results returned to ChatGPT → Review → Continue the same Desktop thread.

    Current findings

    • Codex host-side session tools have been observed working with an existing Desktop thread.
    • An external MCP adapter initializes successfully and responds to ping.
    • Calling tools/list returns -32603: Codex app tools pipe closed.
    • A separately launched App Server can execute tasks but does not establish live visibility in the already-open Desktop session.
    • We have not established a supported external-client binding to the active Desktop host.

    Related: #47425.

    Could the Codex maintainers clarify the supported public contract for the following?

    1. Is there an officially supported endpoint or SDK for an authorized external client to attach to an existing Codex Desktop thread?
    2. What authentication and client-registration mechanism should be used?
    3. Can external turns appear immediately in the active Desktop UI, with execution events synchronized to both clients?
    4. How are concurrent writers, tool approvals, cancellations, and reconnections handled?
    5. Can a ChatGPT Web plugin use this mechanism through an authorized local bridge?
    6. Which Codex Desktop and App Server versions support this workflow?

    If this is not currently supported, please confirm that explicitly and point us to the recommended architecture or tracking issue.

    We are not requesting access to private credentials, undocumented security mechanisms, or internal application databases.

    We can provide sanitized reproduction logs and version information if useful.

  6. polaz commented on Oct 28, 2026

    @polaz

    Could maintainers clarify a narrower integration requirement within this request: attaching to the App Server already owned by a running macOS Desktop, solely to receive thread/deleted and request config/mcpServer/reload at a safe turn boundary?

    With the bundled codex-cli 0.164.0-alpha.11.1, read-only inspection finds Desktop's owner using stdio, no listening TCP or named Unix control endpoint, and no default app-server control socket. app-server proxy --sock is advertised, but app-server daemon version fails because that socket is absent. An independent App Server reading the same persisted thread did not receive the owning process's deletion notification in an isolated fixture; it cannot refresh Desktop-owned MCP connections either.

    Is there a supported endpoint or extension API for these two operations on the existing owner, with a documented minimum version? If this build does not expose one, please identify the required Desktop change. This use case does not need external turns, thread replacement, approval changes, process injection, or restarting active work. The documented protocol methods alone do not establish a route to the live Desktop owner.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions