perf(xcode-ide): switch MCP to gateway tools and unblock handshake#223
perf(xcode-ide): switch MCP to gateway tools and unblock handshake#223cameroncooke wants to merge 3 commits intomainfrom
Conversation
commit: |
| return 'XCODE_SESSION_NOT_READY'; | ||
| } | ||
| return 'XCODE_MCP_UNAVAILABLE'; | ||
| } |
There was a problem hiding this comment.
Duplicated classifyBridgeError logic across two classes
Low Severity
The classifyBridgeError private method is nearly identical in StandaloneXcodeToolsBridge and XcodeToolsBridgeManager (~25 lines each). The only difference is the manager additionally checks clientStatus.connected for timeout sub-classification. This duplication increases the risk of inconsistent bug fixes to error classification logic. A shared utility function accepting an optional connection-status flag would eliminate the redundancy.
Additional Locations (1)
| const clientMocks = { | ||
| connectOnce: vi.fn(), | ||
| listTools: vi.fn(), | ||
| callTool: vi.fn(), |
There was a problem hiding this comment.
New test code uses banned Vitest mocking utilities
Medium Severity
The new test lines add callTool: vi.fn(), clientMocks.callTool.mockReset(), and clientMocks.callTool.mockResolvedValue(...), extending the use of banned Vitest mocking utilities (vi.fn, .mock*). The project testing rules require dependency injection via createMockExecutor / createMockFileSystemExecutor patterns rather than Vitest module mocking.
Additional Locations (2)
Triggered by project rule: Bugbot Review Guide for XcodeBuildMCP
Add manifest-managed xcode_ide_list_tools and xcode_ide_call_tool for MCP xcode-ide access. Keep runtime manifest loading and CLI xcode-ide behavior unchanged. Remove handshake-time bridge tool sync from MCP startup and defer non-critical Xcode state and Sentry enrichment work until after connect to reduce startup latency. Include before/after profiling reports and startup stage instrumentation to measure handshake-path costs and validate improvements. Fixes #210 Co-Authored-By: Claude <noreply@anthropic.com>
Ignore the .claude directory and remove tracked .claude files from the repository index so local agent config is no longer versioned. Refs #210 Co-Authored-By: Claude <noreply@anthropic.com>
edc2527 to
cdd4141
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| const result = await callHandler({ remoteTool: 'toolA', arguments: { foo: 'bar' } }); | ||
| expect(result.isError).toBe(false); | ||
| expect(clientMocks.callTool).toHaveBeenCalledWith('toolA', { foo: 'bar' }, {}); | ||
| }); |
There was a problem hiding this comment.
New gateway tools lack failure path tests
Low Severity
The new xcode_ide_list_tools and xcode_ide_call_tool tools only have happy-path tests. No tests cover bridge failures (e.g., listTools or callTool throwing), unavailable bridge, or timeout scenarios. The project testing checklist requires each tool to have at least one failure-path test.
Triggered by project rule: Bugbot Review Guide for XcodeBuildMCP


Switches MCP
xcode-ideintegration from startup-time proxied tool merging to manifest-managed gateway tools, so server initialization no longer blocks on Xcode bridge tool discovery.This change keeps runtime manifest loading intact, keeps CLI
xcode-idebehavior unchanged, and introduces two MCP tools in thexcode-ideworkflow:xcode_ide_list_toolsxcode_ide_call_toolBoth tools are predicate-gated with
xcodeToolsAvailable(same pattern as existing bridge debug tools), and execute bridge list/call at tool runtime with bounded timeout/error normalization instead of during MCP bootstrap.To reduce handshake latency further without feature loss, bootstrap also defers non-contract-critical work (Xcode state watcher/sync and Sentry shell-heavy enrichment) until after connect. Startup profiling instrumentation and before/after reports were added, with docs/changelog/test updates reflecting the new MCP contract.
Alternatives considered:
tools/listmerge: rejected because it can hang/fail handshake on Xcode approval/connect latency.Refs #210