feat(mcp): require workspaceId in start_claude_session and return path from create_workspace#1274
Conversation
…h from create_workspace
📝 WalkthroughWalkthroughAdds explicit workspaceId/projectId parameters across tools, tracks worktreePath on created workspaces, and shifts start-claude-session to locate and use existing workspaces instead of creating new worktrees; also introduces session-scoped and subagent-scoped argument validators and related error constants. Changes
Sequence Diagram(s)sequenceDiagram
participant Agent as Agent/Client
participant MCP as MCP Validator
participant Desktop as Desktop Tool
participant Store as Workspace Store
rect rgba(100,150,200,0.5)
Note over Agent,Store: New Flow — session uses existing workspace
Agent->>MCP: start_claude_session(deviceId, taskId, workspaceId)
MCP->>MCP: validateSessionArgs()
MCP-->>Agent: validated args (deviceId, taskId, workspaceId)
Agent->>Desktop: call start-claude-session with workspaceId
Desktop->>Store: lookup workspace by workspaceId
Store-->>Desktop: return workspace {id, projectId, branch, ...}
Desktop->>Desktop: append pending terminal setup (workspace.id, projectId, branch, initialCommands)
Desktop-->>Agent: return workspace context (workspaceId, branch)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
start_claude_sessionnow requires aworkspaceIdparameter instead of creating a new workspace internally — callers must first create a workspace viacreate_workspaceand pass its IDcreate_workspacenow returnsworktreePathfor each created workspace so callers know the filesystem pathChanges
packages/mcp): Added requiredworkspaceIdtostart_claude_sessioninput schema and validation; split validators sostart_claude_subagentis unaffectedstart-claude-session: Removed workspace creation logic; looks up existing workspace by ID and sets up pending terminal command on itcreate-worktree: AddedworktreePathtoCreatedWorkspaceinterface and response dataTest Plan
create_workspacevia MCP and verify response includesworktreePathstart_claude_sessionwith a validworkspaceIdand verify it launches in the correct workspacestart_claude_sessionwithoutworkspaceIdand verify it returns an errorstart_claude_subagentstill works withoutworkspaceIdSummary by CodeRabbit
New Features
Improvements