Skip to content

[Feature]: Keep Codex app-server with Gateway for remote execution #101282

Description

@steipete

Summary

Keep the Codex app-server co-located with the OpenClaw Gateway over managed stdio, while routing filesystem and process execution to an authenticated remote Codex execution environment.

Problem to solve

OpenClaw can connect to a separately hosted Codex app-server over WebSocket, but that splits one logical runtime across hosts. Gateway-owned lifecycle, hooks, local MCP servers, workspace projection, authentication state, thread recovery, and app-server state then have different failure and filesystem boundaries.

Upstream Codex documents stdio as the supported app-server transport and TCP WebSocket as experimental and unsuitable for production use. A production remote-workspace topology therefore needs a supported way to keep Gateway and app-server together without forcing command execution onto the Gateway host.

Proposed solution

Add an explicit experimental Codex plugin configuration for registry-backed remote execution:

  • Gateway continues to own and supervise a local codex app-server --listen stdio:// child.
  • Codex app-server receives authenticated Noise registry settings for a selected codex exec-server environment.
  • OpenClaw projects local workspace paths into a configured remote workspace root.
  • Runtime identity includes the remote environment, so changing environments rotates thread bindings instead of resuming against the wrong filesystem.
  • Configuration fails closed for unsupported combinations: remote app-server transport, local stdio MCP servers, Computer Use, OpenClaw sandboxing, sandbox exec-server, and the app-server loopback network proxy.
  • Registry credentials use SecretRefs and never appear in durable runtime fingerprints.
  • Codex app-server 0.142.0 or newer is required, matching the first release with authenticated registry-backed execution environments.

Alternatives considered

  1. Keep app-server remote over WebSocket. This preserves the split lifecycle and relies on an upstream experimental transport.
  2. Mirror Gateway/app-server state and session files between hosts. This adds multi-writer consistency and recovery problems without fixing hook, MCP, or process ownership.
  3. Run Gateway inside every remote workspace. This restores locality but duplicates the control plane and complicates routing, upgrades, and operator ownership.
  4. Use OpenClaw's sandbox exec-server. That is appropriate for Gateway-owned sandboxes, but it is not an authenticated remote environment registry and does not select independently managed workspaces.

Impact

  • Affected: operators running OpenClaw against remote development or execution environments.
  • Severity: high for production remote-workspace deployments; split-host failures can lose thread continuity, execute hooks on the wrong host, or expose host-local paths to the other runtime.
  • Frequency: inherent to every split Gateway/app-server deployment, with user-visible symptoms appearing during reconnects, restarts, recovery, hooks, and local-tool use.
  • Consequence: fewer unsupported transport failures and one canonical owner for app-server lifecycle, auth, thread state, hooks, and local plugin integration.

Evidence/examples

Additional information

The first implementation should remain explicitly experimental until a live registry-backed executor scenario is proven end to end. This issue and the proposed implementation are AI-assisted; the design and code were reviewed against the exact Codex 0.142.5 source contract. A sanitized agent transcript was intentionally omitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.maintainerMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions