From 7dd63699524f2230f4aca663bd852ab44ce69d3f Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Sat, 7 Mar 2026 06:03:30 -0600 Subject: fix(app): task agent title --- packages/ui/src/components/message-part.tsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'packages/ui/src/components') diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index 77e39b1e1..be99f36fd 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -19,7 +19,7 @@ import { import { useData } from "../context" import { useFileComponent } from "../context/file" import { useDialog } from "../context/dialog" -import { useI18n } from "../context/i18n" +import { type UiI18n, useI18n } from "../context/i18n" import { GenericTool, ToolCall } from "./basic-tool" import { Accordion } from "./accordion" import { StickyAccordionHeader } from "./sticky-accordion-header" @@ -123,6 +123,11 @@ export type ToolInfo = { subtitle?: string } +function agentTitle(i18n: UiI18n, type?: string) { + if (!type) return i18n.t("ui.tool.agent.default") + return i18n.t("ui.tool.agent", { type }) +} + export function getToolInfo(tool: string, input: any = {}): ToolInfo { const i18n = useI18n() switch (tool) { @@ -168,12 +173,17 @@ export function getToolInfo(tool: string, input: any = {}): ToolInfo { title: i18n.t("ui.tool.codesearch"), subtitle: input.query, } - case "task": + case "task": { + const type = + typeof input.subagent_type === "string" && input.subagent_type + ? input.subagent_type[0]!.toUpperCase() + input.subagent_type.slice(1) + : undefined return { icon: "task", - title: i18n.t("ui.tool.agent"), + title: agentTitle(i18n, type), subtitle: input.description, } + } case "bash": return { icon: "console", @@ -1475,11 +1485,12 @@ ToolRegistry.register({ const data = useData() const i18n = useI18n() const childSessionId = () => props.metadata.sessionId as string | undefined - const agentType = createMemo(() => { + const type = createMemo(() => { const raw = props.input.subagent_type if (typeof raw !== "string" || !raw) return undefined return raw[0]!.toUpperCase() + raw.slice(1) }) + const title = createMemo(() => agentTitle(i18n, type())) const description = createMemo(() => { const value = props.input.description if (typeof value === "string") return value @@ -1527,9 +1538,8 @@ ToolRegistry.register({
- + - {(type) => } -- cgit v1.2.3