Skip to content

[Bug]: Cancelling worktree setup can remove the checkout an active side chat shares #43219

Done

Description

@AppsAtMe

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. In a disposable local server integration fixture backed by a real Git repository, start a new thread with a managed worktree and hold its setup open.
  2. Wait until the server has bound the checkout to the parent thread while the parent is still preparing.
  3. Open a side chat for the parent through the fixture and confirm it uses the same checkout.
  4. Write a disposable sentinel file in the shared checkout and read it back to confirm it exists.
  5. Cancel the parent’s setup through the fixture, then check whether the checkout and sentinel still exist.

Expected behavior

The side chat should wait until setup is released, or cancelling the parent’s setup should preserve a checkout the side chat is already using.

Actual behavior

The local synthetic server fixture used real Git and admitted the side chat while the parent was still preparing. Cancelling the parent’s setup removed the shared checkout and the verified sentinel file.

On public main, the side-chat guard calls a pending-worktree check that stops blocking once a checkout path has been bound. The setup cancellation cleanup can still force-remove that checkout before the parent run is released.

Impact

Major degradation or frequent failure

Version or commit

Runtime reproduced in a local development fixture. Public main source was inspected at 4c8a324 and rechecked at 72559e1.

Environment

macOS arm64, local development server integration fixture with real Git. A fixture was prepared against the exact public archive at 4c8a324 and remains unverified at runtime.

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

No response

Activity

  1. added
    bug
    needs-triage
    on Nov 26, 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

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions