Skip to content

[Bug]: Diff shows prior branch's changes as deletions after switching checked-out branch mid-thread #8204

Closed

Description

@danielo515

Steps to reproduce:

  1. In a thread, ask the agent to make changes on branch A (checked out).
  2. Ask the agent to switch to and make changes on branch B, which gets checked out.
  3. View the diff for the latest turn.

Expected: Diff for the latest turn shows only the changes made on branch B in that turn.

Actual: The changes previously made on branch A appear in the latest turn's diff as deletions (since branch B doesn't have those changes, the diff-against-branch-A-state treats them as removed).

Likely cause: The diff is computed against a stale base ref (the previously checked-out branch) instead of the newly checked-out branch's actual base.

Activity

  1. juliusmarminge commented on Oct 22, 2026

    @juliusmarminge
    Member

    Reproduced on Linux in the web dev app at ed9b7ca9c5. In one thread: committed an A-only a.txt on branch A, then asked the agent to switch to branch B (created from the original base) and create uncommitted b.txt. The second turn lists a.txt as a deletion and b.txt as an addition. No matching open fix PR found.

    Latest turn diff after switching from branch A to branch B

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions