Skip to content

Codex Chat unavailable after resuming a session through the codex resume picker #896

Closed

Description

@devswha

Split from #518: main already strips the \\?\ prefix from rollout paths and matches thread cwd in both plain and prefixed forms (#582, #714).

Remaining

  • Resuming through the session picker (codex resume or codex resume --all) leaves the pane without a session ID. The pane's recorded directory may also differ from the resumed session's directory, so Codex Chat shows "Conversation unavailable".
  • The server reads a resumed thread only from codex resume <thread-id> on Codex's command line (resumedThread, server/codex.ts L868-L875). The picker forms put no id there.
  • herdr provides no session id either, so the pane gets a chat only when short answers on its screen match a thread in the pane's own directory (server/codex.ts L1170-L1184). A session resumed from another directory is never among those threads.
  • Reported on Windows 11 with codex-cli 0.160.1, but nothing in this path is Windows-specific (not yet reproduced on Linux).
  • A previous attempt, PR fix(chat): find a Codex session resumed through the picker from another folder #717, was closed unmerged.

Activity

  1. added
    bug
    on Oct 17, 2026
  2. zhiganov commented on Oct 18, 2026

    @zhiganov

    Related live confirmation on macOS, with a different entry path from the resume picker.

    Environment

    • herdr-web-ui 0.4.12, installed as a Herdr plugin (commit 05cf983453ac0ad51f8dbfc5a8ce33cf7c1f2aba)
    • Herdr 0.9.5, protocol 22; Codex integration reported current (v10)
    • Android Chrome/PWA over Tailscale Serve; the fallback was also reproducible through the local conversation endpoint, so this was not phone/network-specific

    Observed

    I launched plain codex in directory A and later used a conversation working in directory B. This was not an explicit codex resume <id> launch; I have not reduced the directory/session-switch sequence to a clean minimal reproduction.

    For the one affected pane:

    • Herdr's cwd, foreground_cwd, and foreground Codex process cwd still pointed to A.
    • The active conversation's threads.cwd in Codex's database pointed to B.
    • Herdr exposed no agent_session; the TUI's argv contained only codex, and its process held no rollout JSONL descriptor.
    • Other panes' conversations loaded normally.
    • GET /api/pane/conversation?pane_id=<pane> returned HTTP 200 with source: "scrollback" and turns: []; the UI showed "Conversation unavailable".

    In this installed revision, the Codex branch of server/conversation.ts passes the pane cwd to codexTranscriptPath(). Its fallback candidate query in server/codex.ts filters interactive threads by that cwd, excluding B's conversation unless some other identity evidence supplies it. This looks like the same missing-session-identity / cross-directory discovery mechanism described here, although the launch path differs.

    Verified session-specific workaround

    I obtained the exact current Session ID from /status in the affected Codex TUI, then reported it to Herdr:

    herdr pane report-agent-session <pane-id> \
      --source herdr:codex \
      --agent codex \
      --agent-session-id <verified-session-id>

    Afterward, pane get exposed the expected native session ID, and the conversation endpoint returned source: "codex-transcript" with 22 turns. The conversation also loaded successfully on Android. No agent/Herdr restart, database edit, or plugin source change was needed.

    This is only a manual association for the verified current session, not a general fix or a suggestion to choose the newest thread by directory/recency. Posting here because it confirms that this failure mechanism also occurs on macOS.

  3. devswha commented on Oct 24, 2026

    @devswha
    OwnerAuthor

    Reproduced on Linux and addressed in part by #1790 (Refs, not Fixes). The setup was real Codex 0.163.0 with an isolated herdr session and CODEX_HOME: a thread from folder B, picker-resumed in a pane in folder A.

    Why it fails: nothing ties the pane to its thread.

    • herdr reports no agent_session.
    • The shared app-server daemon, not the TUI, holds the rollout open.
    • The picker leaves no id on argv.
    • The screen fallback only considers folder A's threads.

    What #1790 changes: Codex's opt-in thread-id terminal-title item puts the thread id in the title. Codex 0.163.0 shortens it, e.g. 01a16b42-3c88-7a30-91b3-772fb.... #1790 uses that id only to add that one thread to the screen-match candidates. The chat binds once the pane's screen shows one of its answers, and never on the title alone.

    To use it:

    [tui]
    terminal_title = ["activity", "thread-name", "project-name", "thread-id"]

    Remaining limits, so this issue stays open:

    • With Codex's default title, a picker resume from another folder still shows "Conversation unavailable". No exact signal exists there, and per the maintainer's decision there is no matching by name, cwd or recency.
    • The chat binds only once the screen shows one of that conversation's answers.
    • Known residual (documented, not fixed): a wrong pick needs all three of:
      • a title token that is not Codex's thread-id item but names another conversation, such as a folder or thread literally named with that conversation's UUID;
      • an answer that conversation shares with the pane's real one;
      • the real one's copy of that answer pushed out of its last 1 MiB, for example by a large inline image.
    • A full fix needs herdr or Codex to report each TUI's thread. The manual herdr pane report-agent-session workaround above shows that this path works.
  4. added 2 commits that reference this issue on Oct 25, 2026
    d48e05b
    a8392b3
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions