diff --git a/app/api/projects/[projectId]/agent-chat/route.ts b/app/api/projects/[projectId]/agent-chat/route.ts index c449ae5..1171c02 100644 --- a/app/api/projects/[projectId]/agent-chat/route.ts +++ b/app/api/projects/[projectId]/agent-chat/route.ts @@ -74,7 +74,7 @@ export async function POST( reasoning: data.reasoning ?? null, toolCalls: data.toolCalls ?? [], turns: data.turns ?? 0, - model: data.model ?? "unknown", + model: data.model || null, sessionId, }); } catch (err) { diff --git a/components/OrchestratorChat.tsx b/components/OrchestratorChat.tsx index 46cb9d3..c098af8 100644 --- a/components/OrchestratorChat.tsx +++ b/components/OrchestratorChat.tsx @@ -37,6 +37,29 @@ interface OrchestratorChatProps { placeholder?: string; } +// --------------------------------------------------------------------------- +// Friendly labels for tool call names +// --------------------------------------------------------------------------- + +const TOOL_LABELS: Record = { + spawn_agent: "Dispatched agent", + get_job_status: "Checked job", + list_repos: "Listed repos", + list_all_issues: "Checked issues", + list_all_apps: "Checked deployments", + get_app_status: "Checked app status", + read_repo_file: "Read file", + deploy_app: "Triggered deploy", + gitea_create_issue: "Created issue", + gitea_list_issues: "Listed issues", + gitea_close_issue: "Closed issue", + gitea_comment_issue: "Added comment", +}; + +function friendlyToolName(raw: string): string { + return TOOL_LABELS[raw] ?? raw.replace(/_/g, " "); +} + // --------------------------------------------------------------------------- // Suggestion chips shown before the first message // --------------------------------------------------------------------------- @@ -88,13 +111,14 @@ function MessageBubble({ msg }: { msg: Message }) {
{msg.toolCalls && msg.toolCalls.length > 0 && (
- {msg.toolCalls.map((t, i) => ( + {/* Deduplicate tool calls before rendering */} + {[...new Set(msg.toolCalls)].map((t, i) => ( - - {t} + + {friendlyToolName(t)} ))}
@@ -109,8 +133,10 @@ function MessageBubble({ msg }: { msg: Message }) { {showReasoning ? : } )} - {msg.model && ( - {msg.model} + {msg.model && msg.model !== "unknown" && ( + + {msg.model.includes("glm") ? "GLM-5" : msg.model.includes("gemini") ? "Gemini" : msg.model} + )}
)}