Skip to content

[Windows Desktop] Same thread id on local and SSH remote host: Desktop routes to the stale remote copy and never reconciles remote deletions #52410

Open

Description

@andrewkangkr

Summary

When the same thread id exists on both the local host and an SSH remote host (remote-ssh-discovered:*), Codex Desktop routes the thread to the remote copy, and after the remote copy is deleted the desktop catalog never forgets it. Pinned threads became unopenable (invalid paginated history lineage ...: missing source rollout, failed to resolve rollout path, no rollout found for thread id) while their local rollouts were intact.

Environment

  • Codex Desktop on Windows 11 (26.1002.7124.0, then 26.1007.2314.0), local runtime 0.162.0-alpha.2
  • SSH remote host (macOS) running codex-cli 0.160.0, connected via remote-ssh-discovered

How the duplicate arose

A file-sync tool had copied the Windows host's ~/.codex/sessions into the remote host's live ~/.codex/sessions months earlier. The remote app-server registered those rollouts as its own threads (110 rows, cwd like C:\... or /Users/<user>/C:\...). So 92 thread ids existed on both hosts. (The sync was a user mistake; the issue is how Desktop resolves it.)

Observed

  1. sqlite/codex-dev.db → local_thread_catalog held two rows per id (local and the remote host). Opening a pinned thread routed to the remote host (log: maybe_resume_started ... hostId=remote-ssh-discovered:...), where the rollout no longer existed. The UI shows a globe icon but offers no way to choose the host.
  2. Disconnecting the remote host made the same threads open locally — confirming routing, not data loss.
  3. We removed the 92 rows on the remote with the official thread/delete (app-server JSON-RPC) while Desktop was closed. After reconnecting, Desktop still routed to the remote: the catalog is synced incrementally (local_thread_catalog_sync_state.watermark_updated_at) and deleted threads are never re-observed. last_full_reconciled_at for that host was 5 weeks old. Removing the stale catalog rows (app closed) fixed routing.
  4. One local thread also had thread-project-assignments → remote project/host in .codex-global-state.json; it kept opening on the remote (no rollout found for thread id) until that assignment was removed.

Expected

  • For an id present on several hosts, prefer the host that actually has a readable rollout (or local), or let the user choose the host.
  • Periodically reconcile the catalog against each host (drop rows the host no longer has), or react to thread/deleted on reconnect.
  • A thread assigned to a remote project should not be routed to a host that does not have it.

Related

#42628 (catalog retains deleted chats / missing rollouts), #44947, #34894

Activity

  1. added
    bug
    app
    windows-os
    session
    on Oct 9, 2026
  2. github-actions commented on Oct 9, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

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

    appbugremotesessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions