codex icon indicating copy to clipboard operation
codex copied to clipboard

Windows desktop: pinned chats show disconnected despite SSH access; duplicate catalog entries select older host

Open ViperJuice opened this issue 2 months ago • 2 comments

What version of the Codex App are you using (From “About Codex” dialog)?

Installed Windows package: OpenAI.Codex_26.924.2738.0_x64. Version obtained from the running application's package path, not the About dialog.

What subscription do you have?

Not included in this report; the investigation did not inspect billing/account credentials.

What platform is your computer?

Windows NT 10.0.26200.0 x64 desktop, controlling remote Linux hosts through saved SSH connections. The same remote thread IDs also have catalog entries under Remote Control connection IDs.

What issue are you seeing?

Several pinned Codex chats in the ChatGPT desktop app show disconnected even though the same chats remain readable through the app's thread tools when an explicit SSH host ID is supplied.

Read-only investigation found duplicate local_thread_catalog entries for each affected thread: one under an SSH host ID and another under a Remote Control host ID. For the four affected pinned chats examined, the Remote Control row had an older recency value. Both rows were eligible (missing_candidate = 0, non-ChatGPT source).

The installed renderer contains a deterministic duplicate-selection inconsistency: it sorts catalog entries newest first, then constructs a thread-ID-only map with unconditional Map.set. Later, older entries overwrite the newer entries. The backend host lookup instead selects the newest eligible row.

This is a suspected explanation for the visible disconnected cards, not a confirmed capture of their current in-memory host selection.

What steps can reproduce the bug?

Observed configuration / reproduction candidate (not yet validated from a clean profile):

  1. Have one remote thread represented under both SSH and Remote Control host IDs.
  2. Let the SSH catalog row have newer recency than the Remote Control row.
  3. Load both catalog entries into the renderer and display the thread as a pinned row.
  4. If no eligible manager summary or live-conversation state supersedes the catalog summary, the thread-ID-only catalog map selects the older Remote Control entry.
  5. The hover card prefers that summary's host ID when looking up connection status. If that Remote Control connection is disconnected, the card can show disconnected despite the thread being accessible through SSH.

Minimal illustration of the confirmed map-reduction behavior:

const entries = [
  { threadId: "example", hostId: "ssh-example", sourceRecencyAt: 200, sourceCreatedAt: 100 },
  { threadId: "example", hostId: "remote-control-example", sourceRecencyAt: 150, sourceCreatedAt: 100 },
];
entries.sort((a, b) =>
  b.sourceRecencyAt - a.sourceRecencyAt ||
  b.sourceCreatedAt - a.sourceCreatedAt ||
  a.hostId.localeCompare(b.hostId) ||
  a.threadId.localeCompare(b.threadId)
);
const byThread = new Map();
for (const entry of entries) byThread.set(entry.threadId, entry);
console.log(byThread.get("example").hostId); // remote-control-example

What is the expected behavior?

Host resolution should be consistent between the sidebar, hover card, navigation, and thread tools. A stale alternate-transport catalog entry should not silently override the intended usable host.

If multiple host identities for one thread are ambiguous, preserve host-qualified identity or resolve them through an explicit consistent policy. A supported way to repair/reassociate stale host references would also help.

Additional information

Static evidence from the installed app.asar:

  • webview/assets/app-shared-c568b0b98683.js: XPr deduplicates by host/thread pair, sorts via nFr, then calls eFr to build entriesByConversationId. eFr unconditionally overwrites each non-ChatGPT thread ID. The last duplicate wins: lowest recency, then lowest creation time, then the last host under localeCompare. sourceUpdatedAt is not used by this comparator.
  • .vite/build/main-DAwJoFgo.js: Khe.readThreadHostId filters missing/ChatGPT rows and selects highest recency, then highest creation time, then the first host under localeCompare (after a SQL limit of 100).
  • webview/assets/app-initial-ff48311587c5.js: the catalog selector feeds FA/B4t; summary-backed rows pass their summary through to x2i. The hover-card host precedence is threadSummary?.hostId ?? hoverCardHostConfig?.id ?? generalThreadHostResolver(threadId).

Observed state:

  • Two affected chats already had SSH project assignments; one had a Remote Control assignment; one had no assignment.
  • All four lacked per-thread membership-host entries.
  • The chat-list tool reported the intended SSH host for all four, and explicit SSH-host thread reads succeeded. This confirms access through that tool path, not successful UI resume or the transport state used by the hover card.
  • A separate affected chat began showing connected without an investigative settings/database edit. Another comparison chat had a single SSH catalog row and consistent SSH assignments.

Limitations:

  • The renderer's currently loaded catalog subset, manager summaries, live-conversation host set, runtime override, and actual hover-card props have not been captured.
  • The catalog overwrite behavior is confirmed by static code; its causal role in each visible disconnected card remains unproven.
  • No settings, database rows, session files, or host assignments were changed during this investigation.

Related but not confirmed duplicates: openai/codex#42628 (catalog reconciliation) and openai/codex#41214 (multi-host sidebar state). Neither examined report establishes this specific duplicate-host reduction behavior.

Private chat titles, thread IDs, host/environment IDs, account identifiers, local paths, credentials, and raw logs are intentionally omitted.

ViperJuice avatar Sep 27 '26 00:09 ViperJuice

Additional macOS case, observed on 2026-10-29: a local project sidebar entry opened an older remote copy of the conversation, making recent messages appear missing.

Environment and comparison:

  • Apple Silicon macOS desktop client.
  • Previously running: 26.1023.50603 / build 22391.
  • After update and restart: 26.1023.51421 / build 22530.
  • Local and remote computers have independently stored histories restored/copied from a common snapshot, so some thread UUIDs exist on both computers. This is an important precondition; these are not assumed to be synchronized conversations.

Observed:

  • The local copy of one affected conversation had 21 turns, including the current day's messages; its remote copy had 6 older turns.
  • Clicking its entry under the local project opened a route with an explicit remote-control host ID.
  • Both copies remained readable when the host was explicitly specified. Reopening the local host restored the expected full history, which the user confirmed.
  • Local project folders showed the unexpected remote entries; remote project folders did not show the corresponding local contamination.
  • Sorting/grouping changes did not correct the identity problem and were reverted.

Read-only code/data checks:

  • The running native catalog contained the same thread UUID under local, SSH, and Remote Control host identities.
  • An isolated replay using actual catalog timestamps and the installed comparator/reducer selected the older remote entry after descending recency sort followed by unconditional thread-ID-only Map.set.
  • The installed local-project affinity helper returns null, whereas a remote-project assignment can provide a host ID. This can leave the local entry exposed to the ambiguous fallback.
  • Crucially, the comparator, thread-ID reducer, host-preference logic, and the entire Electron main-process bundle were identical in the official build-22391 and build-22530 packages. The reducer also fails in the previous build's isolated replay. This report therefore does not claim the defect was first introduced by build 22530, and rollback alone is not established as a fix.

The update/restart appears to expose an existing collision when the sidebar rebuilds from catalog entries without a live local conversation overriding them. That activation/state explanation remains an inference; there has not been a clean-profile, end-to-end cold-start reproduction.

Expected: keep host-qualified identities distinct throughout project filtering, sidebar summary lookup, and navigation. Do not silently substitute a remote snapshot for a local project's conversation, including when histories restored on separate devices retain a UUID.

No private conversation titles, UUIDs, environment IDs, local paths, raw transcripts, account identifiers, or credentials are included.

lj2026-web avatar Oct 29 '26 13:10 lj2026-web

Adding a macOS reproduction and a comparison with the next production build.

Environment: Apple silicon Mac, desktop production build 26.1111.71025 (28661), with a Windows device paired through Remote Control. Some chats had been restored on Windows from a Mac history snapshot, preserving their thread IDs.

Reproduction: With the Windows device temporarily unreachable but still paired, click a chat from a local Mac project when the catalog contains a copy under each host. The sidebar opened the Windows route and showed a connection error. The same thread could still be read explicitly on the Mac. Updating the local project membership alone did not change the behavior. Opening it explicitly on the Mac and reassigning it to the same local project let the original sidebar entry open locally in the same running app.

Read-only findings: The desktop catalog contained 147 IDs with both local and remote entries. Logs showed 10 locally backed threads had been routed to Windows at least once. The sidebar fallback sorts entries by descending recency and creation time, then builds a map keyed only by thread ID. A later entry for the same ID overwrites an earlier one. Replaying that fallback offline selected the Windows entry for 146 of the 147 pairs, including the reproduced case. This is a replay of one fallback branch, not a count of 146 UI failures. The exact in-memory state at the time of the failure was not captured.

Version comparison: The built-in updater offered 26.1111.71704 (29030). I compared the production download statically. The thread catalog reducer, host resolver, sidebar summary selection, runtime host hint, and saved section host fallback were byte-for-byte identical to the installed build. I did not install or cold-start the newer build for a live test.

Could the desktop client carry (host ID, thread ID) from the sidebar row through navigation? In a local project, that row should keep the local host even when a matching remote copy exists. A regression test should cold-start with the remote device still paired but offline, verify that the local row opens locally, then reconnect and verify that an explicitly remote entry still opens the Windows copy. Both histories and the pairing should survive throughout.

junyu02 avatar Nov 20 '26 05:11 junyu02