Steps to reproduce:
- In a thread, ask the agent to make changes on branch A (checked out).
- Ask the agent to switch to and make changes on branch B, which gets checked out.
- 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.
Steps to reproduce:
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.