Skip to content

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

Closed
juliusmarminge wants to merge 16 commits into
t3code/codex-turn-mappingfrom
agents/mcp-workspaces/inventory
Closed

feat(mcp): expose thread workspace inventory#8685
juliusmarminge wants to merge 16 commits into
t3code/codex-turn-mappingfrom
agents/mcp-workspaces/inventory

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 29, 2026

Copy link
Copy Markdown
Member

An agent can otherwise see only the branch and worktree path recorded on its thread, which does not establish whether Git agrees, which physical checkouts exist, or which live threads own them.

This change enriches t3_worktree_status with separate recorded and actual state, and adds bounded t3_worktree_list discovery. A dedicated Git inventory path reports canonical repository common-directory and physical worktree-root identities, including detached and stale registrations, without changing the existing paginated vcs.listRefs wire/cache shape.

Results are current-project scoped and read-only. Pages are sliced before status I/O; nested and symlinked recorded paths are resolved through actual Git identity; independent nested repositories are not misattributed; ordinary typed inventory failures make binding counts explicitly incomplete while interruption and defects propagate.

Focused validation:

  • 241 lower-layer tests across real Git inventory, MCP status/list, registration, Claude exposure, contracts, client-runtime cache compatibility, and presentation
  • vp run --filter t3 typecheck
  • vp run --filter @t3tools/contracts typecheck
  • vp run --filter @t3tools/shared typecheck
  • vp run --filter @t3tools/client-runtime typecheck
  • Targeted vp lint, vp fmt --check, and git diff --check

Review base: t3code/codex-turn-mapping at 415ed0f73b97f1655b6282492f81d0b2bba3a9cc. Native stack: #8685#8680. This discovery layer does not add lifecycle pruning, revival, or cleanup.

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: 71b8ce76-89e2-4f74-b444-f8a7e54f290f

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

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


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 718558b.

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 Outdated
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
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 adds a model-visible worktree inventory capability and substantially expands existing worktree status behavior across MCP, contracts, orchestration, and Git infrastructure. The cross-layer runtime impact and non-trivial inventory/path-resolution logic warrant human review.

No code changes detected at 718558b. Prior analysis still applies.

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
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/inventory branch from 067be67 to 45486fb Compare August 30, 2026 17:29
@github-actions github-actions Bot removed the size:XL 500-999 changed lines (additions + deletions). label Aug 30, 2026
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:30
@github-actions github-actions Bot added the size:XXL 1,000+ changed lines (additions + deletions). label Aug 30, 2026
Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Aug 30, 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 1 potential issue.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit d1a6955. Configure here.

Comment thread apps/server/src/vcs/GitVcsDriverCore.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/inventory branch from 602bf69 to 9eaeae0 Compare August 30, 2026 20:14
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-workspaces/inventory branch from 9eaeae0 to bdd0832 Compare September 5, 2026 06:10
Comment thread apps/server/src/mcp/WorktreeMcpService.ts Outdated
@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10566 in the rebuilt MCP stack, following the maintainer request to review thin service wrappers separately from service hardening.

This is not a full feature-parity replacement. This discovers branch-backed refs/worktrees only. Detached unbound inventory and switching an existing checkout require a shared service operation and are intentionally not rebuilt inside MCP. The old workspace work is retained for that extraction.

Closing this mixed proposal without merging. The remote branch agents/mcp-workspaces/inventory and exact head 718558bfe90355b4e072ef0279d4115d6f8e10fc are retained so the service changes can be extracted for separate review later.

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