Codex App shows Handed off to local while thread remains attached to Worktree

Open 💬 2 comments Opened Jul 19, 2026 by cdomigan

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

Unknown because the About dialog is not accessible to the agent. The connected Codex CLI/app-server reports 0.144.5.

What subscription do you have?

Unknown because subscription details are not exposed to the agent.

What platform is your computer?

macOS Codex desktop app connected to a Linux remote development host. Remote host: Linux 6.1.0-50-cloud-amd64 x86_64.

What issue are you seeing?

After using Handoff to move a thread from a managed worktree to Local, the conversation displays “Handed off to local” beneath the handoff event, but the Environment sidebar still displays “Worktree”. The agent runtime also remains attached to the managed worktree path.

The Git branch is moved successfully to the Local checkout and the managed worktree becomes detached, but subsequent agent turns continue editing the old worktree. This caused a later ProductRecordScreen change to be written into the detached worktree instead of the Local checkout and required manually copying the file into Local.

Observed state:

  • Local checkout /home/cdomigan/projects/job-manager had branch codex/seed-overview-tab checked out.
  • Managed worktree /home/cdomigan/.codex/worktrees/600c/job-manager was on detached HEAD.
  • The conversation displayed “Handed off to local”.
  • The Environment sidebar displayed “Worktree”.
  • The agent filesystem sandbox still identified the managed worktree as its writable workspace.
  • No Local terminal session was attached to the thread.

A screenshot from 2026-07-20 10:32 NZST clearly shows “Handed off to local” at the bottom of the conversation and “Worktree” in the Environment sidebar at the same time. The originating agent cannot upload the local screenshot through the available issue API, but it is available in the originating Codex thread.

What steps can reproduce the bug?

  1. Start a Codex App thread in a managed Worktree.
  2. Create or check out a feature branch and make changes.
  3. Use Handoff to move the thread to Local.
  4. Wait for the “Handed off to local” completion item.
  5. Observe that the Environment sidebar still says “Worktree”.
  6. Send another coding request in the same thread.
  7. Observe that the agent receives the managed worktree as its writable workspace and edits there, even though the branch has moved to Local.

What is the expected behavior?

After a successful Handoff to Local, the thread runtime, writable workspace, terminal context, and Environment sidebar should all point to Local. Subsequent agent edits should land in the Local checkout.

The Codex Worktrees documentation states that handing off moves both the chat and code so work can continue in the other checkout.

Additional information

This is more than a display-only inconsistency because subsequent edits can silently land in the wrong checkout. The sidebar and runtime agree with each other, while the completed Handoff event and Git branch placement indicate Local.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗