-
Notifications
You must be signed in to change notification settings - Fork 850
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I am describing a concrete problem or use case, not just a vague idea.
Area
apps/desktop
Problem or use case
A common first step when starting a new thread is to ask the AI to rebase onto origin/main to ensure work starts from an up-to-date base. This is currently the only way to sync inside T3 Code — doing it before thread creation requires a separate terminal.
Once the rebase runs, the diff panel immediately shows all commits pulled in from origin/main as if they are part of the current branch's changes. This makes the diff unusable for the rest of the session.
Proposed solution
Option A — Smarter diff computation
The diff panel could be made aware of the branch's actual base, so that commits inherited from the base branch via a rebase are excluded from the diff. The result would only reflect changes that belong to the current branch, regardless of rebase history.
Option B — Sync base branch during thread creation
The thread/worktree creation flow could offer an option to update the base branch to its latest remote state before branching. This would eliminate the need to rebase at all, since the worktree would already start from an up-to-date base.
Both options would solve the problem. Option A fixes the root cause and is correct behavior regardless of how the state was reached. Option B is a proactive workflow improvement that avoids the situation entirely.
Why this matters
Anyone working in an active repo where main moves fast. This repo is a good example — new commits land constantly, so starting a thread without syncing first means the diff is polluted before any real work begins.
Smallest useful scope
Compute the diff relative to the merge base with the base branch, so commits inherited via a rebase are excluded. No new UI needed — just a correct diff from the start.
Alternatives considered
As a workaround, the user can manually sync main from a terminal or IDE before creating the thread. Asking the AI to rebase as the first message is the natural in-tool alternative, but that is exactly what triggers the problem.
Risks or tradeoffs
For the diff fix: repos that intentionally branch off an older commit rather than the tip of main could see unexpected behavior if the merge base detection is wrong. For the sync option: automatically fast-forwarding main before branching assumes the user always wants to start from the latest remote state, which may not always be the case.
Examples or references
No response
Contribution
- I would be open to helping implement this.