Skip to content

[Bug]: Explain checkout failures caused by uncommitted changes when creating a thread #7928

Description

@bjesuiter

Before submitting

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

Area

apps/web, apps/desktop

Steps to reproduce

  1. Open T3 Code on a repository using the current checkout (rather than a separate worktree).
  2. Make changes that remain uncommitted and that would be overwritten by switching to the branch/ref for a new thread.
  3. Create a new chat thread.
  4. T3 attempts to switch the repository ref with git checkout.

Expected behavior

T3 should surface a clear, actionable error, for example:

Git checkout failed because the current branch has uncommitted changes that would be overwritten. Commit, stash, or discard those changes before creating a new thread.

The message should identify this as a normal Git safety check rather than an unexplained T3 failure.

Actual behavior

The UI displays a generic notification:

Failed to switch ref.

Git command failed in GitVcsDriver.switchRef.checkout (...): git checkout failed

This does not explain that uncommitted changes in the current local branch are the reason git checkout failed, nor what the user needs to do to proceed.

Impact

Major degradation or frequent failure

Version or commit

T3 Code desktop app (observed 2026-08-22; version not captured)

Environment

macOS; local Git checkout with uncommitted files.

Workaround

Commit, stash, or discard the pending working-tree changes before creating the thread.

Supporting screenshot

The observed notification showed only the generic GitVcsDriver.switchRef.checkout failure; the underlying Git reason was not shown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions