[Bug]: Sidebar thread rows keep VCS work active with no VCS surface open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Description
Visible sidebar thread rows keep per-thread VCS status subscriptions active even when no diff, branch picker, or VCS surface is open. With several visible worktree-backed threads, this produces continuous Git work and adds meaningful background load.
Steps to reproduce
- Open a project containing several visible branch/worktree threads.
- Keep the main chat surface open; do not open a diff or branch picker.
- Observe server traces for VCS status, ref listing, and Git subprocess activity.
- On macOS, close only the renderer window while leaving the desktop backend running, then observe the same traces again.
Expected behavior
Passive sidebar rows should not independently trigger repeated Git subprocess work. Repository/worktree status should be shared, coalesced, visibility-aware, and cancelled when its consumer unmounts.
Actual behavior
Each visible sidebar row with branch/worktree metadata mounts a VCS environment status subscription. Selected-thread controls also maintain status/ref subscriptions even when their UI is not open.
In one sanitized recent trace slice of 800 records with the main chat visible and no diff open, there were:
- 54 Git command trace entries
- 12 VCS process runs
- 7 remote-status refreshes
- 4 ref-list operations
Closing only the renderer window immediately reduced VCS/Git trace entries to zero and lowered the overall trace rate substantially, while the backend and provider sessions remained alive. This isolates the work to mounted renderer subscriptions rather than terminal sessions or an external tunnel.
Environment
- T3 Code 0.0.32
- macOS desktop app
- Multiple visible worktree-backed threads
Suggested direction
- Share and deduplicate status subscriptions by repository/worktree identity.
- Suspend remote/ref polling unless the corresponding surface needs it.
- Cancel work promptly when rows are hidden, collapsed, or unmounted.
- Lazy-load pull-request/remote status rather than deriving it for every passive row.
Raw logs and screenshots are intentionally omitted because they contain private workspace metadata.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the sidebar thread rows' VCS environment status subscriptions and the selected-thread controls that maintain status/ref subscriptions. Reproduce the described Git trace activity with the main chat visible and no diff open, then verify that passive rows no longer independently poll and that work is cancelled when consumers are hidden, collapsed, or unmounted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- desktop, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100