Skip to content

Feature request: host-local Codex daemons with shared session history and safe cross-node resume #52050

Open

Description

@biosilicon

Summary

Please support independent Codex managed app-server/background daemons on Linux hosts that share network-mounted storage, while providing unified session history and safe cross-host session resumption.

This would help users working across multiple machines with separate runtime environments but shared project storage.

Use case

  • Multiple Linux hosts independently run Codex CLI and managed background daemons.
  • The hosts access common, network-mounted home and/or project storage.
  • A user wants to find, read, and later continue a Codex conversation from a different host, without depending on the original host's daemon remaining reachable.

The intended model is one independent daemon per host, with shared access to durable conversation history.

Problem

Using the same CODEX_HOME on independent hosts can cause host-local daemon state—such as process IDs, Unix sockets, locks, and mutable runtime files—to be treated as if it belonged to one machine.

Using a separate CODEX_HOME per host improves daemon isolation, but splits session history, indexes, and metadata. Sessions created on one host are no longer reliably discoverable or resumable from another.

Users therefore lack a supported way to combine safe host-local daemon operation with cross-host session continuity.

Requested behavior

  1. Host-local daemon state. Run an independent managed daemon on each host, with appropriately scoped sockets, PIDs, locks, and other transient runtime state. A socket pathname on shared storage must not be mistaken for a reachable local daemon on another host.
  2. Unified session discovery and read access. Provide a supported way, such as codex resume --all or an equivalent interface, to discover and read conversation history from other hosts. Show origin/ownership information where relevant.
  3. Safe cross-host resume. Allow an idle or completed conversation to be resumed on another host while preserving its conversational context, subject to workspace availability and path validation/remapping.
  4. Single-writer protection and explicit ownership. Prevent concurrent writers from modifying the same conversation on different hosts. Expose current ownership and provide safe handoff when possible, or a clear error while the original session remains active.
  5. First-class storage separation. Support a configuration that separates host-specific daemon/runtime state from shared durable session history and indexes, with suitable coordination for network filesystems. Users should not need unsupported symlinks or manual copying of JSONL/SQLite files.

Acceptance scenario

  1. Start separate Codex daemons on two hosts that can access the same project storage.
  2. Create and finish a conversation on host A.
  3. On host B, discover the conversation, inspect its history, and resume it safely through host B's daemon.
  4. If the conversation is still active on one host, a competing resume on another host is prevented without corrupting or silently forking the session.

Preserving conversation history and enabling safe idle-session handoff is the priority. Migrating live processes, shells, or running commands is outside the scope of this request.

Related issues

These reports concern related host-identity and lifecycle failures. This request focuses on the complementary capability: host-local daemon isolation without losing cross-host session continuity.

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    app-serverIssues involving app server protocol or interfaces
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Oct 8, 2026
  2. Nakagawa-master commented on Oct 8, 2026

    @Nakagawa-master

    One important handoff edge is not yet covered by the acceptance scenario: a previous host can write late after the new host legitimately takes ownership. "Only one active writer" and an idle/lease-expired flag alone do not guarantee that older in-flight writes are rejected.

    For example:

    1. Host A owns session S under generation 12 and starts an append/checkpoint write, but its response is delayed during an NFS/network interruption.
    2. A is judged inactive; host B acquires generation 13 and resumes S from the last confirmed durable checkpoint.
    3. A's generation-12 write finally reaches the shared storage, after B's handoff.

    Unless the durable write path fences the old generation, A can mutate a session now owned by B. That can corrupt the resumed history/metadata or make a tool result from the old execution appear current, even though discovery and the original single-writer check appeared correct.

    Suggested addition to the contract:

    • Each ownership transfer advances a monotonic session writer generation / fencing token. A session append, checkpoint, and mutable index update is accepted only if its generation is still current at the authoritative commit boundary; a local PID, timestamp, file lock, or expired lease by itself is not sufficient proof. An implementation may choose another mechanism, but it needs equivalent stale-writer rejection, including on network filesystems.
    • Keep historical readability distinct from current authority to execute. Host B may display A's earlier transcript without inheriting permission to execute a late A tool call or treating a late A result as a new B result. If the last external side effect has an uncertain outcome, preserve that uncertainty for reconciliation instead of blindly retrying it as part of the handoff.
    • Define the resume point as the last confirmed durable boundary, not merely the latest locally observed turn. If the required fencing or state verification is unavailable, a clear fail-closed resume error is preferable to silently forking/mixing histories.

    Three useful negative acceptance cases alongside the existing A→B success scenario:

    1. Delayed old writer: pause A's durable append, hand S to B, then release A's append; it must be rejected or quarantined without altering B's accepted history.
    2. Competing handoff: A renewal races B acquisition; at most one generation can commit subsequent writes, and discovery can still read prior history.
    3. Late tool result: A's tool finishes after B has resumed; the result can be recorded as historical/uncertain evidence if appropriate, but cannot silently become an authorized fresh B turn or cause automatic re-execution of an ambiguous external effect.

    This is an extension to the requested single-writer handoff semantics, not a claim that Codex currently implements (or violates) any particular cross-host fencing design.

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

    CLIIssues related to the Codex CLIapp-serverIssues involving app server protocol or interfacesenhancementNew feature or requestsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions