Before submitting
Area
apps/web
Steps to reproduce
- Use a long-lived integration branch in a local checkout, for example
dev.
- Open a PR from
dev to main and merge it.
- Continue using the same
dev branch after the merge for new work.
- Create a new T3 Code thread on the local checkout while
dev is checked out.
- Complete a turn and inspect the branch/PR indicator and Sidebar V2 thread state.
Concrete observed case: GitHub PR rebel-tickets/NewWeb#182 was merged from dev into main. New unrelated threads created later on the still-active dev branch display #182 as their PR.
Expected behavior
A new thread on a reused long-lived branch should not inherit a historical merged PR merely because its head branch name matches.
T3 Code should associate a terminal PR only while it still describes the current branch state. If the branch HEAD has advanced beyond the PR head after merge, the historical PR badge/state should be ignored. Consequently, unrelated new threads should remain active.
Actual behavior
T3 Code displays the historical merged PR on every new thread using the reused dev branch. The merged PR state is then fed into automatic settlement, so each new unrelated thread settles when its turn finishes even when Auto-settle inactive threads is disabled.
The settle behavior is secondary damage. The root problem is stale PR association for a reused branch.
This appears adjacent to #4460, which prevents PR state from a different branch affecting settlement, but exact branch-name equality is insufficient for a long-lived branch reused after a merge. It is also related to #4752/#4755, which retain terminal PR state for local checkouts.
Suggested minimal fix: for merged/closed PRs, verify that the current branch HEAD still corresponds to the PR head commit before displaying or applying its terminal state. If the branch has advanced, discard the historical association. Open PR selection can continue using the existing branch match.
Impact
Major degradation or frequent failure
Version or commit
Current T3 Code desktop build as of 2026-07-30
Environment
macOS desktop app, local checkout, Sidebar V2, GitHub repository, Codex provider
Logs or stack traces
No runtime error. GitHub reports the historical PR as:
baseRefName=main
headRefName=dev
state=MERGED
Workaround
Disable Sidebar V2 or create threads on a new uniquely named branch/worktree. Disabling Auto-settle inactive threads does not help because merged/closed PR settlement is unconditional.
Before submitting
Area
apps/web
Steps to reproduce
dev.devtomainand merge it.devbranch after the merge for new work.devis checked out.Concrete observed case: GitHub PR
rebel-tickets/NewWeb#182was merged fromdevintomain. New unrelated threads created later on the still-activedevbranch display#182as their PR.Expected behavior
A new thread on a reused long-lived branch should not inherit a historical merged PR merely because its head branch name matches.
T3 Code should associate a terminal PR only while it still describes the current branch state. If the branch HEAD has advanced beyond the PR head after merge, the historical PR badge/state should be ignored. Consequently, unrelated new threads should remain active.
Actual behavior
T3 Code displays the historical merged PR on every new thread using the reused
devbranch. The merged PR state is then fed into automatic settlement, so each new unrelated thread settles when its turn finishes even whenAuto-settle inactive threadsis disabled.The settle behavior is secondary damage. The root problem is stale PR association for a reused branch.
This appears adjacent to #4460, which prevents PR state from a different branch affecting settlement, but exact branch-name equality is insufficient for a long-lived branch reused after a merge. It is also related to #4752/#4755, which retain terminal PR state for local checkouts.
Suggested minimal fix: for merged/closed PRs, verify that the current branch HEAD still corresponds to the PR head commit before displaying or applying its terminal state. If the branch has advanced, discard the historical association. Open PR selection can continue using the existing branch match.
Impact
Major degradation or frequent failure
Version or commit
Current T3 Code desktop build as of 2026-07-30
Environment
macOS desktop app, local checkout, Sidebar V2, GitHub repository, Codex provider
Logs or stack traces
Workaround
Disable Sidebar V2 or create threads on a new uniquely named branch/worktree. Disabling
Auto-settle inactive threadsdoes not help because merged/closed PR settlement is unconditional.