Skip to content

Commit 51953dc

Browse files
committed
fix(ui): restore tool selection feedback in onboarding and render selected tool names in review
1 parent 549c0d7 commit 51953dc

2 files changed

Lines changed: 33 additions & 9 deletions

File tree

ui/src/components/onboarding/steps/ReviewStep.tsx

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,34 @@ export function ReviewStep({ onboardingData, isLoading, onBack, onSubmit }: Revi
7474
{onboardingData.selectedTools && onboardingData.selectedTools.length > 0 ? (
7575
<ScrollArea className="h-[100px] w-full rounded-md border p-3 bg-muted/50">
7676
<div className="flex flex-wrap gap-2">
77-
{onboardingData.selectedTools.map(tool => (
78-
<Badge variant="secondary" key={tool.mcpServer?.name} className="flex items-center gap-1">
79-
<FunctionSquare className="h-3 w-3" />
80-
{tool.mcpServer?.name}
81-
</Badge>
82-
))}
77+
{onboardingData.selectedTools.flatMap((tool, toolIndex) => {
78+
const serverName = tool.mcpServer?.name || "unknown-server";
79+
const toolNames = tool.mcpServer?.toolNames || [];
80+
81+
if (toolNames.length === 0) {
82+
return (
83+
<Badge
84+
variant="secondary"
85+
key={`${serverName}-${toolIndex}-no-tool-name`}
86+
className="flex items-center gap-1"
87+
>
88+
<FunctionSquare className="h-3 w-3" />
89+
{serverName}
90+
</Badge>
91+
);
92+
}
93+
94+
return toolNames.map((toolName) => (
95+
<Badge
96+
variant="secondary"
97+
key={`${serverName}-${toolName}-${toolIndex}`}
98+
className="flex items-center gap-1"
99+
>
100+
<FunctionSquare className="h-3 w-3" />
101+
{toolName}
102+
</Badge>
103+
));
104+
})}
83105
</div>
84106
</ScrollArea>
85107
) : (

ui/src/components/onboarding/steps/ToolSelectionStep.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
77
import { Info, ChevronDown, ChevronRight, FunctionSquare, Search } from 'lucide-react';
88
import { LoadingState } from "@/components/LoadingState";
99
import { ErrorState } from "@/components/ErrorState";
10-
import { getToolResponseDisplayName, getToolResponseDescription, getToolResponseIdentifier, getToolResponseCategory, toolResponseToAgentTool } from "@/lib/toolUtils";
10+
import { getToolResponseDisplayName, getToolResponseDescription, getToolResponseIdentifier, getToolResponseCategory, toolResponseToAgentTool, serverNamesMatch } from "@/lib/toolUtils";
1111
import type { Tool, ToolsResponse } from "@/types";
1212
import { Input } from "@/components/ui/input";
1313

@@ -39,8 +39,10 @@ export function ToolSelectionStep({
3939
if (tool.type === "Agent" && tool.agent) {
4040
return false; // Agents don't match ToolResponse objects
4141
} else if (tool.type === "McpServer" && tool.mcpServer) {
42-
return tool.mcpServer.name === toolResponse.server_name &&
43-
tool.mcpServer.toolNames.includes(toolResponse.id);
42+
// server_name may be "namespace/name" while saved name can be just "name"
43+
// (or vice versa), so normalize before comparing.
44+
return serverNamesMatch(tool.mcpServer.name, toolResponse.server_name) &&
45+
tool.mcpServer.toolNames.includes(toolResponse.id);
4446
}
4547
return false;
4648
};

0 commit comments

Comments
 (0)