You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(mcp): address bugbot/greptile review on per-server tool discovery
- Workspace-scoped `mcpKeys.serverToolsWorkspace(workspaceId)` prefix for bulk
invalidations (create-server, refresh-all, SSE workspace fallback, OAuth
fallback). The previous `mcpKeys.serverTools()` prefix was global and
invalidated every workspace's tools cache.
- `useMcpToolsQuery` folds `useMcpServers().isLoading` into the aggregate
`isLoading` so mounting no longer flashes an "empty tools" state during the
servers-list fetch. Aggregate `error` is suppressed when any per-server
query already returned data so one slow server can't blank out the others.
- `useForceRefreshMcpTools` invalidates the per-server query keys of servers
whose force refresh failed, so stale tools don't linger.
- `DiscoveryOutcome` error variant carries the original error, restoring the
OAuth-exemption check that `getErrorMessage(...)` previously erased.
- `discoverServerTools(userId, serverId, workspaceId, forceRefresh = false)`
now consults the positive + negative cache by default. Per-server React
Query refetches hit the cache instead of re-paying the listTools timeout;
callers that explicitly bypass cache (refresh route, OAuth callback, bulk
POST refresh) pass `forceRefresh: true`. Negative-cache hits throw a typed
`McpConnectionError` so the route layer can surface a fast 503.
0 commit comments