Repository navigation
Description
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
- Start Codex Desktop with an existing local project registered.
- In a terminal,
cdto that project's root and start a new session usingcodex. - Leave Desktop running and check its local Project and Recents/sidebar.
- Switch to another local project and back.
- 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
- Create several CLI sessions in a local working directory.
- Verify that
codex resume --allstill lists them. - Add the same directory as a new local Project in Desktop.
- Observe that the Project contains no historic sessions despite matching their
cwd. - 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
threadsentries exist, and all six rollout JSONL files exist codex resume --allcan see the sessions- The session
cwdmatches the registered Project root - All six examined
threads.project_idvalues wereNULLat the time of inspection - Five older sessions had
source='vscode'andthread_source=NULL, while a new Desktop-created session hadthread_source='user' .codex-global-state.jsonincludedprojectsMigrated=true,threadAssignmentsMigrated=false, and 14pendingThreadAssignmentIds
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
- Codex app should live-refresh CLI-created local sessions #21974 (CLI/Desktop session refresh)
- [macOS] CLI-created conversations appear in both Recents and their project, even after restarting #49435 (older CLI sessions missing on project add, Recents/project grouping inconsistency)
- Desktop keeps its own session-to-project map in .codex-global-state.json and ignores (later reverts) thread/metadata/update project changes #54482 (Desktop vs app-server project mapping inconsistency)
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
github-actions commentedon Oct 22, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
trainee315 commentedon Nov 11, 2026
I observed the project-grouping behavior from Reproduction B on Windows as well.
26.1103.7773.0(x64)0.167.1, launched from native PowerShell with the default%USERPROFILE%\.codexhomeI 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.