Add version control command center#3177
Conversation
- Query open change requests across supported remotes - Surface actionable branch rows only when local branch is behind the MR/PR base - Pass remote repository context to GitHub, GitLab, and Azure DevOps CLIs
…ol-panel-work # Conflicts: # apps/web/src/components/ChatView.tsx # apps/web/src/environmentApi.ts # apps/web/src/environments/runtime/service.threadSubscriptions.test.ts # packages/client-runtime/src/wsRpcClient.ts
- Extract shared source control panel state and API wiring - Move VS Code project scope and subagent parent resolution into runtime helpers - Add tests for presentation state and subagent control resolution
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
- Treat same-name remotes as publish/pull upstreams - Split sync-state logic into shared web module - Cover publish target behavior with tests and docs
- Add `forceRefresh` support to query runners and runtime execution - Refresh cached SWR atoms before resolving so panel data stays current - Cover first-run and cached-refresh behavior with runtime tests
- Move sync refresh feedback into a compact spinner icon - Keep the banner for non-refresh sync messages
- Sum merged working-tree row stats across both sides - Keep default compare ref on the repository default branch - Restrict diverged merge sync to the checked-out branch - Surface tracked discard failures and rename sources - Move shared panel logic into the logic module
- Infer rename status for numstat fallback entries - Align diverged merge sync guard and disabled state - Clarify aggregate working-tree stats and date buckets
…ol-panel-work # Conflicts: # apps/desktop/src/electron/ElectronMenu.ts # apps/server/src/sourceControl/AzureDevOpsCli.ts # apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.test.ts # apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.ts # apps/server/src/sourceControl/GitHubCli.ts # apps/server/src/sourceControl/GitHubSourceControlProvider.test.ts # apps/server/src/sourceControl/GitHubSourceControlProvider.ts # apps/server/src/sourceControl/GitLabCli.ts # apps/server/src/sourceControl/SourceControlProvider.ts # apps/server/src/vcs/VcsStatusBroadcaster.ts # apps/server/src/ws.ts # apps/web/src/components/ChatView.tsx # apps/web/src/components/Sidebar.logic.ts # apps/web/src/hooks/useHandleNewThread.ts
There was a problem hiding this comment.
Effect Service Conventions: one finding in DesktopBackendManager.ts. See inline comment.
Posted via Macroscope — Effect Service Conventions
- Summarize panel behavior and required reliability safeguards - Record validation ports and source control reference document
- Reuse server panel actions and shared branch and change models - Wire the screen into mobile Git menus and navigation - Configure local iOS signing for Apple team 6JGX8M7Z3L - Document fork-specific mobile source-control behavior
- Sequence snapshot refreshes and ignore superseded responses - Invalidate cached details when repository snapshots change - Preserve add-remote input after command failures
- Refresh equal VCS snapshots and expanded diffs - Enrich file stats and split staged discard operations - Gate merge sync on a checkout that owns the branch - Cover the native presentation helpers
- Keep selection updates pure and clear stale checkout state - Refresh snapshots after failed actions and isolate enrichment failures - Guard branch deletion and preserve rename and safe-area details
- Keep mutation failures visible across status-triggered refreshes - Exclude conflict-only selections from discard counts and actions - Document and test the corrected native behavior
- Compare tracked stash files against the stash base - Fall back to the untracked stash parent when needed - Add coverage for both stash diff paths
- Open file changes in the shared native review diff renderer - Expand branch commits and expose mobile sync, merge, rebase, and delete actions - Refine repository summary and document the mobile inspection flow
- Remove stale merge-maintenance snapshot details - Update GitLab error and validation documentation
…ol-panel-work # Conflicts: # apps/web/src/components/ChatView.tsx
- Enable the global virtual store - Resolve patched @effect/vitest and alchemy peer dependencies
- Add incremental working-tree snapshots with full fallback - Deduplicate automatic all-remotes fetches across worktrees - Keep manual fetches authoritative and document freshness behavior
- Preserve workspace routing while viewing native diffs - Keep fetch and stash state stable across navigation - Match remote branches by their exact tracked upstream
- Let mobile users choose a remote and recover interrupted loads - Isolate selected-file commits from unrelated staged changes
- Preserve the real index when selected-file commits fail - Keep destructive menus grouped and rebase refs positional
- Treat post-commit index sync as best-effort cleanup - Apply literal pathspecs to selected commit paths
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c990bc9. Configure here.
- Match shared stage and unstage pathspec behavior - Cover glob-shaped selected file names

Summary
Adds a Git-backed Version Control command center to the web right panel and a native mobile route. It is scoped to the active project/repository cwd, works from draft or existing conversations once repository context is available, and keeps Git operations server-authoritative across browser, desktop, VS Code, and remote clients.
The panel focuses on actionable repository work rather than being a full Git dashboard: dirty working trees, local branch sync state, stashes, remotes, sibling worktrees, likely fork branches, and open change-request bases.
What Changed
SOURCE_CONTROL.mdas the branch-specific behavior and validation reference for the Version Control panel.SourceControlPanelServiceRPC support for snapshots, branch/stash/commit/compare data, selected-file commit and stash flows, discard operations, branch actions, remote actions, and provider-derived PR/MR base checks.VcsStatusBroadcasterandVcsLocalWatch, including ref-counted local watchers,.git/event filtering, gitignore-aware suppression, explicit local refreshes, and sibling worktree watcher retention.ActionableandRemotessections, working-tree file selection, inline diffs, branch/stash/commit rows, searchable compare bases, guarded destructive actions, context menus, manual fetch controls, and a conservative five-minute Actionable remote fetch.expectedBranchwrite guards, and environment/thread/cwd-scoped panel state.glab mr list --repoinstead of an ambiguous scheme-less host/path locator, without duplicating a configured base-URL path prefix already present in the remote path.mainormaster.stash@{n}renumbering after stash create/drop operations does not show details for the wrong stash.Why
T3 Code needs a compact place to answer "what repository work needs attention now?" without forcing users into a full external Git UI. This change keeps the surface decision-oriented: commit or stash selected changes, inspect branch sync state, publish or sync branches, review stashes, and notice when a PR/MR base has moved.
The server-owned design keeps behavior consistent across clients and avoids browser-side Git execution, while the periodic fetch and local watchers keep the panel current without introducing a high-frequency polling loop.
Validation
SourceControlPanelService, VCS broadcasting and Git driver behavior, provider base detection and error handling, self-hosted GitLab CLI behavior, and desktop context-menu integration.pnpm exec vp checkpassed with 0 errors and 9 existing warnings in unrelated web files.pnpm exec vp run typecheckpassed.pnpm exec vp run lint:mobilepassed its available static checks; optional SwiftLint, ktlint, and detekt checks were skipped because those tools are not installed.13782, web client on5742, and disposable throwaway repository verified that an intentional selected-file commit failure surfaces throughvcs.panel.commitStagedwithout staging either file; after removing the failing hook, the selected-only commit succeeded, included onlyselected.txt, leftdeselected.txtunstaged, and left the real index empty.T3 Code Devclient or reusable.appartifact was installed; the TypeScript-only workflow correctly avoided a native rebuild.Proof
Note
High Risk
Large cross-cutting surface touching Git mutations, thread metadata, multi-provider auth, and concurrent snapshot/cache behavior across web, mobile, desktop, and server.
Overview
Adds a server-owned Version Control command center on the web right panel and a native full-screen route, wired through new panel RPCs, live VCS watchers, and shared
@t3tools/shared/sourceControlsync/compare rules documented inSOURCE_CONTROL.md.Web and thread integration mounts
SourceControlPanelper environment/thread/cwd with cached UI state, Actionable vs Remotes layout, selected-file commit/stash/discard, branch/stash/remotes actions, sibling worktrees, andChatViewmetadata routing withexpectedBranchguards. Mobile addsVersionControl/VersionControlDiffoverlay routes from Git menus, snapshot sequencing, cwd-scoped working-tree enrichment, publish-remote prompting, and model helpers covered by unit tests.Server and providers extend
SourceControlPanelServiceand VCS broadcasting (debounced local watches,.git/filtering, conservative fetch cadence). GitHub/GitLab/Azure/Bitbucket gain remote-scoped change-request lookups, optional commit author avatars, and errors normalized throughsourceControlProviderError/sanitizeErrorCauseso panel RPCs get bounded diagnostics. Desktop context menus now honor explicitseparatoritems and still insert a separator before the first destructive action when it leads the menu. Client runtime addsforceRefreshon atom queries for authoritative panel reads.Reviewed by Cursor Bugbot for commit 73c923a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Version Control command center panel to web and mobile apps
SourceControlPanelServiceon the server and wires ~30 new WebSocket RPC endpoints in ws.ts, covering staging, committing, pull/push, branch operations, remotes, and stash actions; mutating operations trigger a git status refresh.getCommitAvatarUrlmethod and adds per-providershowCommitAuthorAvatarsettings defaulting tofalse.VcsStatusBroadcasterthat debounce non-.gitchange events and trigger status refreshes across sibling worktrees.Macroscope summarized 73c923a.