Skip to content

Desktop project-worktree task reports cwd / despite a valid attached checkout #51021

Open

Description

@dpearson2699

What version of the Codex App are you using (From “About Codex” dialog)?

Unified ChatGPT/Codex Desktop 26.930.41038 (build 13022), read from the installed app's Info.plist.

What subscription do you have?

ChatGPT Pro.

What platform is your computer?

Darwin 25.6.0 arm64 arm

What issue are you seeing?

A task created with create_thread for a saved Git project and a new managed worktree has a valid physical checkout, but read_thread reports its native cwd as /. Task-scoped repository operations then try to use a non-repository directory.

The task runs successfully when shell commands explicitly set the actual managed worktree as their working directory. The problem is the disagreement between the native task metadata and that existing assigned worktree. Reattaching the exact managed worktree through attach_worktree succeeds but leaves read_thread.cwd unchanged at /.

A locally installed PR-monitor extension that consumes the native readThread(...).cwd refuses activation with:

Checkout verification failed: fatal: not a git repository (or any of the parent directories): .git

Both that extension's tool control and its UI control produce the same error. The extension is an observed consumer, not a claimed stock Codex feature. The native metadata mismatch is independently visible through read_thread.

What steps can reproduce the bug?

Observed once during an ordinary task creation; a minimal stock-install reproduction has not yet been established.

  1. Discover an existing saved local Git project with list_projects.
  2. Create a new task using the returned project ID and this worktree target, where the starting branch already exists:
{
  "target": {
    "type": "project",
    "projectId": "<saved-project-id>",
    "environment": {
      "type": "worktree",
      "startingState": {
        "type": "branch",
        "branchName": "origin/<existing-feature-branch>"
      }
    }
  },
  "prompt": "Inspect the existing pull request from a dedicated worktree."
}
  1. After asynchronous creation resolves, observe that the managed worktree exists and can run git status, git rev-parse --show-toplevel, and branch/head checks successfully when addressed explicitly.
  2. Call read_thread for that same actual task ID. In the affected task it reports cwd: "/" while its command records use the assigned managed worktree.
  3. Call attach_worktree from the affected task with the exact existing managed worktree. The call succeeds; another read_thread still reports /.
  4. A task-scoped repository consumer using the native task cwd fails as shown above. Ordinary follow-up messages did not repair the mismatch.

A preceding task created through the same project/worktree API on this installation reports its correct managed-worktree cwd. The affected task and physical checkout are retained for recovery; no metadata database or app files were edited during diagnosis.

What is the expected behavior?

A successfully created project-worktree task should retain its assigned working directory in the native task metadata. Attaching an existing managed worktree should either synchronize the task's execution/metadata binding or clearly report that it does not repair that binding. Repository consumers should be able to resolve the task's actual checkout without private-state edits or task replacement.

Additional information

This installation has local desktop patches, including the PR-monitor extension, permission handling, Browser policy, and task-list visibility. Patch interaction has not been ruled out, and no clean-install reproduction or source-level cause is claimed. The repository also has a checked-in setup script that selects its default branch; the task corrected that branch locally, and the physical checkout is clean at the intended published head. That branch selection does not explain why native metadata reports /, but it is included as reproduction context.

Searched existing reports on task cwd, create_thread, worktrees, and repository lookup. Related reports have different observed entry points: #47394 concerns a local-to-existing-worktree UI handoff; #39764 concerns missing projectId with an otherwise correct cwd; #42001 concerns explicit command cwd being ignored despite correct metadata. Here a newly created managed-worktree task has incorrect native cwd metadata while explicit command workdirs work.

Private repository names, paths, commits, PR links, task IDs, and source contents are intentionally omitted. No raw diagnostics are attached.

Verified recovery observation

After the affected task finished its initial turn and its commands had settled, an ordinary continuation started a genuinely new turn in the same chat. At the beginning of that turn, native read_thread.cwd reported the correct managed checkout. The local monitor consumer then activated successfully and delivered a PR event to that chat. No app restart, checkout transfer, new chat, private metadata edit or code change was performed.

The earlier follow-up messages arrived while the initial turn was still running and did not repair the mismatch. This distinguishes a fresh turn from an in-progress steer in the observed incident. It is a bounded recovery observation, not a demonstrated source-level fix or a guarantee for every task; the initial creation-time cwd mismatch remains reproducible evidence from this installation.

Activity

  1. added
    bug
    app
    app-server
    on Oct 5, 2026
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

    appapp-serverbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions