Skip to content

[macOS][Codex Desktop] CLI-created sessions only appear after app restart; existing sessions not auto-grouped into local project #56089

Open

Description

@hexcola

Summary

On macOS, a new session created by standalone Codex CLI while Codex Desktop is running does not appear in the Desktop sidebar immediately. Switching between local projects does not refresh it. After fully quitting and relaunching the Desktop app, the newly created CLI session appears under the correct local Project.

There is also an existing-session discovery/assignment inconsistency: adding a local project whose root matches the cwd of older CLI sessions initially leaves the project empty, but Move to Project can make an already visible session appear under it.

These are observed behaviors; they may have distinct causes.

Environment

  • Codex CLI: codex-cli 0.163.0
  • OS: Darwin 25.6.0 arm64 arm (macOS, Apple Silicon)
  • Codex Desktop: unified ChatGPT/Codex desktop application; exact build/version not yet captured
  • Local session store: default ~/.codex
  • Reproduced: October 22, 2026

Reproduction A: external CLI sessions not live-discovered

  1. Start Codex Desktop with an existing local project registered.
  2. In a terminal, cd to that project's root and start a new session using codex.
  3. Leave Desktop running and check its local Project and Recents/sidebar.
  4. Switch to another local project and back.
  5. Fully quit and relaunch the Desktop app.

Actual

  • The new CLI session is not shown during the running Desktop process.
  • Switching project selection does not make it appear.
  • After relaunch, the session appears and is automatically associated with the correct local Project.

Expected

Desktop should discover externally created local CLI sessions and refresh sidebar/project membership without a full restart (or provide an explicit refresh action).

Reproduction B: pre-existing CLI sessions not associated when project is added

  1. Create several CLI sessions in a local working directory.
  2. Verify that codex resume --all still lists them.
  3. Add the same directory as a new local Project in Desktop.
  4. Observe that the Project contains no historic sessions despite matching their cwd.
  5. For a session that is visible in Recents, use Move to Project.

Actual

  • The registered local project initially shows no historic sessions.
  • Manual Move to Project associates a visible session successfully.
  • Codex sessions have also been observed in both ChatGPT and Codex Recents, making visibility/grouping unclear.

Expected

Older sessions should be discoverable and consistently associated with a registered local project, or users should have a supported way to reconcile/reindex assignments.

Read-only diagnostics (sanitized)

For the affected local project:

  • SQLite PRAGMA integrity_check: ok
  • Six matching threads entries exist, and all six rollout JSONL files exist
  • codex resume --all can see the sessions
  • The session cwd matches the registered Project root
  • All six examined threads.project_id values were NULL at the time of inspection
  • Five older sessions had source='vscode' and thread_source=NULL, while a new Desktop-created session had thread_source='user'
  • .codex-global-state.json included projectsMigrated=true, threadAssignmentsMigrated=false, and 14 pendingThreadAssignmentIds

These data points do not establish causation. A one-record experimental thread_source edit (after backing up) did not restore visibility; manual editing internal databases is not a recommended workaround. Sessions remained intact and CLI-accessible.

Impact

Developers switching between Codex CLI and Desktop see stale/incomplete project histories, may believe conversations have disappeared, and must restart the app or manually move sessions to recover visibility/grouping.

Related reports

Suggested investigation

Please check whether the Desktop subscribes to external local session creation/update events or invalidates its thread-list cache, and whether existing-session/project reconciliation is consistently performed on project registration versus startup.

No private absolute paths, session IDs, session contents, or raw state files are included.

Activity

  1. added
    bug
    app
    session
    on Oct 22, 2026
  2. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. trainee315 commented on Nov 11, 2026

    @trainee315

    I observed the project-grouping behavior from Reproduction B on Windows as well.

    • Codex Desktop Windows package: 26.1103.7773.0 (x64)
    • Codex CLI: 0.167.1, launched from native PowerShell with the default %USERPROFILE%\.codex home

    I started two interactive CLI chats in a local Git repository that, to my recollection, was not yet registered as a project in Desktop. The repository is now registered. Desktop's recent and history listings both return the two chats. Their working directory exactly matches the registered project path, but both entries still have projectId: null. They are missing from the project's chat list, while chats with project membership can be found there.

    Expected: when adding a local project, Desktop should surface existing local CLI chats whose working directory matches the project root, or offer to associate them during project setup.

    I verified the current state of the two sessions and the registered project. The original registration timing is based on recollection. I did not test the live refresh behavior in Reproduction A.

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

    appbugsession

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions