Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): discover Claude commands in the active workspace #12426

Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/12426/headopened View on GitHub

Claude workspace snapshots discover project skills but keep the server-wide slash-command list. Commands loaded by the CLI from the project therefore remain absent from the composer, particularly in packaged desktop installs whose server starts in the home directory.

Read the CLI initialization commands in the requested workspace through the existing snapshot path. Preserve the machine account and model metadata, retain the built-in compact command, and return a failed snapshot when initialization fails so the registry does not cache an incomplete menu. The registry already deduplicates and bounds workspace snapshots.

Fixes #12214. Related #7882 addresses this through a broader discovery API; this change uses the workspace snapshot API already on main.

Validation: 24 focused capability-probe and skill-discovery tests pass, including isolated command lists for two workspaces and recovery after a failed probe. Server typecheck and targeted lint pass. Tests use the SDK boundary without model calls.

Model: GPT-6 Harness: Codex in T3 Code

Summary by CodeRabbit

  • New Features

    • Claude capabilities and skills are now tailored to the active workspace.
    • Workspace-specific slash commands remain separate from machine-level commands.
    • Standard compacting support remains available alongside discovered workspace commands.
  • Bug Fixes

    • Failed capability checks no longer permanently replace available command menus.
    • Subsequent checks can recover and return to a ready state after a temporary failure.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Approvability

      Verdict: Approved at 05f14c5

      Macroscope's review found this PR approvable — This is a small, well-scoped server bug fix that makes existing Claude command discovery workspace-specific and preserves machine metadata on the existing snapshot path. It includes focused coverage for multiple workspaces and probe recovery, with no product-default or static-analysis changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Review Change StackReview Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: adc60755-88a8-4047-badc-192b003d683a

      📥 Commits

      Reviewing files that changed from the base of the PR and between 52e4b4429359904441039a286c61eaafe8474451 and 05f14c5951db753981a301af0c5566eeea7959ce.

      📒 Files selected for processing (3)
      • apps/server/src/provider/Drivers/ClaudeDriver.ts
      • apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts
      • apps/server/src/provider/Layers/ClaudeProvider.ts

      Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      Claude workspace snapshots now combine workspace capability commands and skills while preserving machine-level provider data. The Claude driver uses this snapshot path, and tests cover multiple workspaces, probe errors, and recovery.

      Changes

      Claude workspace snapshot

      Layer / File(s)Summary
      Workspace snapshot composition
      apps/server/src/provider/Layers/ClaudeProvider.ts, apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts
      Adds readClaudeWorkspaceSnapshot, which probes capabilities and discovers skills for a workspace. It merges deduplicated commands, preserves machine commands, reports probe errors, and supports later recovery.
      Driver workspace refresh integration
      apps/server/src/provider/Drivers/ClaudeDriver.ts
      The Claude driver uses readClaudeWorkspaceSnapshot for enabled providers. The disabled-provider path remains unchanged.

      Priority: ➖ Normal

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Sequence Diagram(s)

      sequenceDiagram
        participant ClaudeDriver
        participant readClaudeWorkspaceSnapshot
        participant probeClaudeCapabilities
        participant discoverClaudeSkills
        ClaudeDriver->>readClaudeWorkspaceSnapshot: Pass workspace cwd and environment
        readClaudeWorkspaceSnapshot->>probeClaudeCapabilities: Probe workspace commands
        readClaudeWorkspaceSnapshot->>discoverClaudeSkills: Discover workspace skills
        probeClaudeCapabilities-->>readClaudeWorkspaceSnapshot: Return slash commands or error
        discoverClaudeSkills-->>readClaudeWorkspaceSnapshot: Return skills
        readClaudeWorkspaceSnapshot-->>ClaudeDriver: Return workspace snapshot

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to 05f14

      Workspace command discovery remains isolated to the active project while probe failures retain the existing provider state. No actionable merge-blocking risk remains.

      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the main change: discovering Claude commands in the active workspace.
      Description check✅ PassedThe description explains what changed, why it changed, the failure behavior, validation performed, and linked issues. UI changes are not applicable. Although it does not use the template headings or i…
      Linked Issues check✅ PassedThe change satisfies #12214. ClaudeDriver.snapshotForCwd passes the requested workspace cwd to readClaudeWorkspaceSnapshot. That function runs the Claude initialization probe with that cwd, re…
      Out of Scope Changes check✅ PassedThe changed files are limited to Claude workspace snapshot wiring and its capability-probe tests. The changes directly implement the command discovery requirements in #12214. No unrelated product beha…
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    4. Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

      Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

    5. juliusmarminge closed this

    6. Understood. This touches the provider layer being replaced for V2, so I accept the closure and will defer this fix. If the same behavior remains after V2 lands, I will reproduce it against the new implementation before proposing a focused follow-up.

Sign in to join this conversation.