Skip to content

Codex Desktop sidebar project disappears when clicked with iCloud local project and stale remote host state #31491

Description

@hohohohoh5959-glitch

Bug report: Codex Desktop sidebar project disappears when clicked

Summary

In Codex Desktop on macOS, a saved local project appears in the sidebar, but clicking it causes the sidebar project entry to disappear. The project is still returned by the Codex app project API, and the underlying folder still exists.

Environment

  • App: Codex Desktop
  • OS: macOS
  • Codex app version from config: 26.623.141536
  • Local user: /Users/chanu
  • Project path:
    /Users/chanu/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Obsidian Vault
  • There is also a symlink/legacy path:
    /Users/chanu/Documents/Obsidian Vault

Expected behavior

Clicking the saved Obsidian Vault project should open/select the project and keep it visible in the sidebar.

Actual behavior

The Obsidian Vault project appears, but when clicked it disappears from the sidebar. Reopening/re-adding the same folder does not reliably fix it.

Reproduction notes

  1. Add/open local project:
    /Users/chanu/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Obsidian Vault
  2. Confirm it appears in the Codex Desktop sidebar.
  3. Click the project entry.
  4. Project disappears from the sidebar.
  5. Reopen/re-add the project.
  6. The same symptom repeats.

Diagnostics observed

The Codex app project listing still returns the project correctly:

{
  "projectId": "/Users/chanu/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Obsidian Vault",
  "projectKind": "local",
  "label": "Obsidian Vault",
  "path": "/Users/chanu/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Obsidian Vault",
  "hostId": "local"
}

After the project disappears, .codex-global-state.json has repeatedly been observed changing:

{
  "selected-remote-host-id": "remote-control:env_e_6a38ac01ecec8328a52af75817a90865",
  "pinned-project-ids": []
}

The expected corrected state is:

{
  "selected-remote-host-id": "local",
  "pinned-project-ids": [
    "/Users/chanu/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Obsidian Vault"
  ]
}

There were stale local/remote project paths in multiple places:

  • /Users/chanu/Documents/Obsidian Vault
  • /Users/chanukim/Documents/Obsidian Vault
  • /Users/chanserver/Documents/Obsidian Vault
  • /Users/chanserver/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Obsidian Vault

Local DBs and session files were manually rewritten so local thread cwd fields point to:

/Users/chanu/Library/Mobile Documents/com~apple~CloudDocs/Obsidian/Obsidian Vault

After that rewrite, list_threads returns local Obsidian threads with the iCloud path, but the sidebar still disappears in the visible app UI.

Workaround attempted

A temporary LaunchAgent was installed to keep rewriting .codex-global-state.json so that:

  • selected-remote-host-id remains local
  • pinned-project-ids contains the iCloud Obsidian Vault path
  • stale remote thread summaries for the old remote host are removed

The LaunchAgent is running, but the user still reports the project disappearing in the UI, which suggests the sidebar render/store logic may be using another in-memory source or recomputing from stale data.

Why this looks like an app bug

  • The project exists on disk.
  • The Codex app project API returns the project correctly.
  • config.toml, state_5.sqlite, codex-dev.db, and session cwd values have been aligned to the same iCloud path.
  • The UI still removes/hides the project on click.
  • The app appears to revive stale remote-host/sidebar state even after local state cleanup.

Request

Please investigate Codex Desktop sidebar project state handling when:

  • a local project is inside iCloud Drive,
  • a legacy symlink path exists,
  • previous local/remote hosts had threads under the same logical project,
  • remote thread summaries or selected remote host state are present.

The bug seems related to project identity/path canonicalization and/or sidebar state being overwritten by stale remote host data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingremotesessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions