Uh oh!
There was an error while loading. Please reload this page.
feat(mcp): expose thread workspace inventory - #8685
Conversation
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Warning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
Thread transfer impact
This comment will update automatically after the next completed run. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a substantial agent-facing worktree inventory capability and changes existing status behavior, Git identity handling, and the MCP response contract. Its read-only scope limits operational risk, but the new runtime surface and shared VCS changes warrant human review. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
067be67 to
45486fbCompareUh oh!
There was an error while loading. Please reload this page.
Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit d1a6955. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Fixes review: #2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: #2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: #2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: #2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: #2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Fixes review: #2829 (comment) Co-authored-by: codex <codex@users.noreply.github.com>
Adapt grouped tool summaries and the floating working timer to V2 run, attempt, and queue state. Bring over the composer, keyboard, and disclosure transitions while retaining the V2 activity inspector and queue controls. Keep OV2 web composer and grouping behavior intact; share only the existing command label parser with mobile.
602bf69 to
9eaeae0Compare
Problem
An agent can see only the branch and worktree path recorded on its own thread. That does not reveal whether Git still agrees, which physical worktrees are available, whether they are dirty, or which live threads are bound to them.
Change
t3_worktree_statuswith separate recorded and actual workspace state plus an agreement resultt3_worktree_listresults with bounded thread bindings and per-entry availabilityvcs.listRefswire payload or cache shapeBehavior
These tools are read-only and current-project scoped. Inventory pages are sliced before per-worktree status reads, one missing or unreadable checkout produces an explicit entry outcome instead of failing the entire page, and plain non-repository project roots return a truthful status. Nested independent repositories are not attributed to a containing checkout. The tools do not create, switch, remove, prune, revive, or repair worktrees.
Validation
vp test run apps/server/src/mcp/WorktreeMcpService.test.ts(60 tests)vp test run apps/server/src/vcs/GitVcsDriverCore.test.ts(58 tests)vcs.listRefsdecode/cache compatibility coverageDependency
Bottom of native stack #8711, rooted on
agents/mcp-controls/base-490318aat490318afa505d3d033295eca12d7e62b4b922725. The dependent checkout mutation is PR #8680. This is independent of lifecycle PR #5589.Implemented by GPT-5.6-Sol via Codex in T3 Code.
Note
Medium Risk
Breaking change:
WorktreeMcpStatusResultadds required fields. New Git inventory and binding-resolution logic touches thread workspace attribution; mistakes could mis-report bindings or agreement, though tools are read-only and project-scoped.Overview
Adds read-only workspace discovery for agents:
t3_worktree_listpages Git-registered checkouts in the current project (branch, dirty state, availability, thread bindings) andt3_worktree_statusnow compares recorded thread metadata to on-disk Git state via anagreementfield.Git gains
listWorktrees(canonical paths, common dir, detached entries) wired throughGitWorkflowService; list/status resolve nested or symlinked recorded paths against repository identity without changing thevcs.listRefswire shape. Claude’s read-only MCP allowlist, tool registration, presentation labels, and docs are updated accordingly.Reviewed by Cursor Bugbot for commit 9eaeae0. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
listWorktreesoperation toWorktreeMcpServiceand extendstatusresultt3_worktree_listMCP tool that returns a paginated inventory of project git worktrees with per-worktree branch, git status, availability, and durable thread bindings.listWorktrees(cwd)toGitVcsDriverandGitWorkflowServiceto enumerate worktree checkouts including detached ones, with canonicalized real paths viafileSystem.realPath.WorktreeMcpStatusResultwithrecordedWorkspace,actualWorkspace, andagreementfields that compare the thread's recorded checkout against the physical repo state.WorktreeMcpStatusResultschema now requires three new fields (recordedWorkspace,actualWorkspace,agreement); existing consumers of the status result must decode the new shape. Local branch refs inreadGitRefsSnapshotnow includeprunableworktrees whose directories still exist.Macroscope summarized 9eaeae0.