fix(server): discover Claude commands in the active workspace #12426
main fromrefs/pull/12426/head·opened View on GitHubClaude 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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
05f14c5Macroscope'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).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.tsapps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.tsapps/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.tsAdds 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.tsThe Claude driver uses readClaudeWorkspaceSnapshotfor 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 snapshotSuggested reviewers:
t3dotggMerge Risk: ⚪ Minimal · up to
05f14Workspace 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 name Status Explanation Title check ✅ Passed The title clearly and concisely describes the main change: discovering Claude commands in the active workspace. Description check ✅ Passed The 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 ✅ Passed The change satisfies #12214.ClaudeDriver.snapshotForCwdpasses the requested workspacecwdtoreadClaudeWorkspaceSnapshot. That function runs the Claude initialization probe with thatcwd, re…Out of Scope Changes check ✅ Passed The 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 ✅ Passed No 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.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.
juliusmarminge closed this
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.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes