Skip to content

Commit 3a8d2ba

Browse files
fixed the tools desciption bug (#1079)
fixes(ui): correct tool descriptions and agent card display issues -Changed server reference comparison from partial name matching to full reference matching, ensuring tools display their correct descriptions and prevent adding the same tool multiple times -Resolved AgentCard overlay interfering with model name visibility Fixes incorrect tool descriptions in ToolsSection and SelectToolsDialog components, and improves AgentCard UI rendering. Closes issue #1003 --------- Signed-off-by: killjoycircuit <[email protected]> Signed-off-by: Rutuj Dhawale <[email protected]>
1 parent cebffe2 commit 3a8d2ba

File tree

7 files changed

+158
-97
lines changed

7 files changed

+158
-97
lines changed

ui/src/app/models/new/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ interface ModelParam {
4545
value: string;
4646
}
4747

48-
// Helper function to process parameters before submission
49-
5048
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5149
const processModelParams = (requiredParams: ModelParam[], optionalParams: ModelParam[]): Record<string, any> => {
5250
const allParams = [...requiredParams, ...optionalParams]
@@ -254,13 +252,12 @@ function ModelPageContent() {
254252
};
255253
fetchModelData();
256254
return () => { isMounted = false; };
257-
}, [isEditMode, modelConfigName, providers, providerModelsData, modelConfigNamespace]);
255+
}, [isEditMode, modelConfigName, providers, providerModelsData, modelConfigNamespace, isLoading]);
258256

259257
useEffect(() => {
260258
if (selectedProvider) {
261259
const requiredKeys = selectedProvider.requiredParams || [];
262260
const optionalKeys = selectedProvider.optionalParams || [];
263-
264261
const currentModelRequiresReset = !isEditMode;
265262

266263
if (currentModelRequiresReset) {
@@ -610,3 +607,8 @@ export default function ModelPage() {
610607
</React.Suspense>
611608
);
612609
}
610+
611+
612+
613+
614+

ui/src/components/AgentCard.tsx

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DeleteButton } from "@/components/DeleteAgentButton";
55
import KagentLogo from "@/components/kagent-logo";
66
import Link from "next/link";
77
import { useRouter } from "next/navigation";
8-
import { Pencil, AlertCircle, Clock } from "lucide-react";
8+
import { Pencil } from "lucide-react";
99
import { k8sRefUtils } from "@/lib/k8sUtils";
1010
import { cn } from "@/lib/utils";
1111

@@ -19,6 +19,7 @@ export function AgentCard({ agentResponse: { agent, model, modelProvider, deploy
1919
agent.metadata.namespace || '',
2020
agent.metadata.name || ''
2121
);
22+
2223
const isBYO = agent.spec?.type === "BYO";
2324
const byoImage = isBYO ? agent.spec?.byo?.deployment?.image : undefined;
2425
const isReady = deploymentReady && accepted;
@@ -29,6 +30,24 @@ export function AgentCard({ agentResponse: { agent, model, modelProvider, deploy
2930
router.push(`/agents/new?edit=true&name=${agent.metadata.name}&namespace=${agent.metadata.namespace}`);
3031
};
3132

33+
const getStatusInfo = () => {
34+
if (!accepted) {
35+
return {
36+
message: "Agent not Accepted",
37+
className:"bg-red-500/10 text-red-600 dark:text-red-500"
38+
};
39+
}
40+
if (!deploymentReady) {
41+
return {
42+
message: "Agent not Ready",
43+
className:"bg-yellow-400/30 text-yellow-800 dark:bg-yellow-500/40 dark:text-yellow-200"
44+
};
45+
}
46+
return null;
47+
};
48+
49+
const statusInfo = getStatusInfo();
50+
3251
const cardContent = (
3352
<Card className={cn(
3453
"group relative transition-all duration-200 overflow-hidden min-h-[200px]",
@@ -69,37 +88,12 @@ export function AgentCard({ agentResponse: { agent, model, modelProvider, deploy
6988
)}
7089
</div>
7190
</CardContent>
72-
73-
{!isReady && (
91+
{statusInfo && (
7492
<div className={cn(
75-
"absolute inset-0 rounded-xl flex flex-col items-center justify-center z-20 backdrop-blur-[2px]",
76-
!accepted
77-
? "bg-destructive/90"
78-
: "bg-secondary/90"
93+
"absolute bottom-0 left-0 right-0 z-20 py-1.5 px-4 text-right text-xs font-medium rounded-b-xl",
94+
statusInfo.className
7995
)}>
80-
<div className="text-center px-6 py-8 max-w-[80%]">
81-
<div className="flex justify-center mb-4">
82-
{!accepted ? (
83-
<AlertCircle className="h-12 w-12 text-destructive-foreground drop-shadow-lg" />
84-
) : (
85-
<Clock className="h-12 w-12 text-secondary-foreground drop-shadow-lg" />
86-
)}
87-
</div>
88-
<h3 className={cn(
89-
"font-bold text-2xl mb-3 drop-shadow-lg",
90-
!accepted ? "text-destructive-foreground" : "text-secondary-foreground"
91-
)}>
92-
{!accepted ? "Agent not Accepted" : "Agent not Ready"}
93-
</h3>
94-
<p className={cn(
95-
"text-base drop-shadow",
96-
!accepted ? "text-destructive-foreground/95" : "text-secondary-foreground/90"
97-
)}>
98-
{!accepted
99-
? "Configuration needs review"
100-
: "Still deploying..."}
101-
</p>
102-
</div>
96+
{statusInfo.message}
10397
</div>
10498
)}
10599
</Card>

0 commit comments

Comments
 (0)