Skip to content

feat(mcp): expose thread workspace inventory - #8685

Open
juliusmarminge wants to merge 10 commits into
agents/mcp-controls/base-490318afrom
agents/mcp-workspaces/inventory
Open

feat(mcp): expose thread workspace inventory#8685
juliusmarminge wants to merge 10 commits into
agents/mcp-controls/base-490318afrom
agents/mcp-workspaces/inventory

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

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

  • enrich t3_worktree_status with separate recorded and actual workspace state plus an agreement result
  • add bounded, cursor-based t3_worktree_list results with bounded thread bindings and per-entry availability
  • add a dedicated internal Git worktree inventory read that returns canonical common-directory and physical worktree-root identity
  • include detached and missing/prunable registered entries without changing the existing paginated vcs.listRefs wire payload or cache shape
  • resolve each distinct nested or symlinked recorded path through Git identity before attributing it to a physical checkout
  • expose both read tools consistently, including Claude read-only permission handling, presentation labels, tests, and docs

Behavior

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)
  • focused contracts, client-runtime, Git workflow, MCP registration, and Claude adapter coverage from the stack
  • old-shape vcs.listRefs decode/cache compatibility coverage
  • real GitWorkflow non-repository status plus detached, symlink, nested-repository, archived-binding, missing-path, and stale-entry coverage
  • targeted server TypeScript check and targeted lint

Dependency

Bottom of native stack #8711, rooted on agents/mcp-controls/base-490318a at 490318afa505d3d033295eca12d7e62b4b922725. 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.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a43cd388-b23e-4dd4-9aeb-a3031e7fa4e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 067be67.

This comment will update automatically after the next completed run.

Comment thread packages/contracts/src/git.ts Outdated
@juliusmarminge
juliusmarminge marked this pull request as ready for review August 29, 2026 22:44
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread docs/orchestration-v2/orchestrator-mcp-server.md
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 29, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit 0130019. Configure here.

Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
Comment thread apps/server/src/mcp/WorktreeMcpService.ts
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces a production MCP worktree-inventory capability with new contracts, Git enumeration, filesystem/status reads, thread-binding aggregation, and changes to the existing worktree-status path. Its cross-layer scope and shared VCS behavior exceed a small bounded additive change.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge
juliusmarminge changed the base branch from t3code/codex-turn-mapping to agents/mcp-controls/base-490318a August 30, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant