Skip to content

[Bug]: A finished worktree checkout can close the chat after you dismiss the branch sheet #39561

Closed

Description

@StiensWout

Before submitting

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

Area

apps/mobile

Steps to reproduce

  1. On an Android phone emulator, open a chat from the thread list in a test Git project whose post-checkout hook takes 10 seconds and succeeds.
  2. Tap Git controls in the chat header.
  3. Tap More.
  4. Tap Branches & worktrees.
  5. Enter an unused branch name under New worktree.
  6. Tap Create worktree.
  7. Tap Close on the branch sheet while the checkout is still running.
  8. Wait for the checkout to finish.

Expected behavior

The chat stays open while the worktree finishes and attaches to it.

Actual behavior

The chat closes when the worktree finishes, returning you to the thread list.

Worktree checkout flow

After checkout finishes

Impact

Minor bug or occasional failure. People who dismiss the branch sheet during a slow checkout are taken out of the chat when it succeeds.

Version or commit

main at 59651c1761. The cause is at apps/mobile/src/features/threads/git/GitBranchesSheet.tsx:128.

Environment

Pixel_9_API_37, Android 17.0, Android Emulator on Linux x64.

Logs or stack traces

Commands that reproduce it on the device
"$agent_device_command" press 'text="Delayed checkout"' --settle "${agent_device_target_args[@]}"
"$agent_device_command" press 'label="Git controls"' --settle "${agent_device_target_args[@]}"
"$agent_device_command" press 'text="More"' --settle "${agent_device_target_args[@]}"
"$agent_device_command" wait text "Branches & worktrees" 10000 "${agent_device_target_args[@]}"
"$agent_device_command" press 'text="Branches & worktrees"' --settle "${agent_device_target_args[@]}"
"$agent_device_command" fill 'text="feature/mobile-thread"' "feature/delayed-checkout" --settle "${agent_device_target_args[@]}"
"$agent_device_command" press 'label="Create worktree"' "${agent_device_target_args[@]}"
"$agent_device_command" press 'label="Close"' "${agent_device_target_args[@]}"
"$agent_device_command" wait 12000 "${agent_device_target_args[@]}"
"$agent_device_command" snapshot -i "${agent_device_target_args[@]}"

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 20, 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

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions