openai / openai/codex

Codex Desktop reassigns an existing worktree chat to a newly added clone with the same Git remote

Open
#37,792 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug session
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

Summary

An existing Codex worktree chat was automatically reassigned in the sidebar/project metadata from its original local project to a newly created local project backed by an independent clone of the same repository.

I did not use Move, Handoff, or any other action intended to change the chat's project. The chat's actual cwd and Git common directory still belong to the original project.

Environment
  • ChatGPT desktop app: 26.803.41515 (build 6321)
  • macOS 26.5.2 (25F84)
  • Thread ID: 019f6e26-35d9-7aa1-a3b2-3753d3a3433d
  • Workspace: Codex-managed worktree
Steps to reproduce
  1. Add an existing repository clone as local project A.
  2. Create and use a Codex worktree chat under project A.
  3. Independently clone the same private Git repository to a different local path. This clone has its own .git directory but the same origin URL.
  4. Add that second clone as local project B.
  5. Reopen or inspect the existing chat from step 2.
Actual behavior

The existing chat appears under project B even though its workspace still points to project A.

Observed project association transition:

  • Before (2026-08-10T02:45:54.893Z):
    • project: main-harness
    • projectId: local-67eba96cd1902df645147d53129386bd
  • After project B was added (2026-08-10T07:56:21.562Z):
    • project: ClassIn Harness Worker
    • projectId: 85300336-b4af-4bf2-8db9-4eb3e00894fd

The same thread ID is present in both log records.

The thread still reports:

  • cwd: ~/.codex/worktrees/22ce/classin_flutter_harness
  • Git common dir: ~/Documents/eeo_projects/ai/classin_flutter_harness/.git

Project B is a different clone at:

  • ~/Documents/eeo_projects/classin-harness-worker/classin_flutter_harness

The two clones have separate .git directories. Only their private origin URL and repository content are shared.

Expected behavior

An existing chat should remain associated with its original saved local project unless the user explicitly moves or hands it off. Matching should preserve the saved project/path or Git common-directory identity and must not reassign chats merely because another clone has the same remote URL.

Impact

This makes an old chat unexpectedly appear inside a different project and is easy to miss. It creates confusion about which repository the chat belongs to and raises the risk of users running commands or pushing from the wrong checkout.

Diagnostics and privacy

Relevant app log:

~/Library/Logs/com.openai.codex/2026/08/10/codex-desktop-582ad2f3-cf13-4630-ad4a-a55028996f2c-1436-t0-i1-023608-0.log

I intentionally did not attach the full log because it contains session summaries and potentially sensitive project information. The two timestamped association records above are the minimal relevant evidence.

Related but distinct: #11019 discusses threads after physically moving a project directory. In this case the original directory was not moved or deleted; adding a second independent clone caused the existing chat's project association to change.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the project-A/project-B sequence with two independent clones, then inspect the association records in the cited Codex desktop log. Trace how the existing thread ID is matched to a local project; done means the chat remains associated with project A unless explicitly moved or handed off.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.