fix(tui): keep background marker with subagent label (#30271)
This commit is contained in:
@@ -2218,9 +2218,13 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
||||
|
||||
const content = createMemo(() => {
|
||||
if (!props.input.description) return ""
|
||||
const description =
|
||||
props.metadata.background === true ? `${props.input.description} (background)` : props.input.description
|
||||
let content = [`${Locale.titlecase(props.input.subagent_type ?? "General")} Task — ${description}`]
|
||||
let content = [
|
||||
formatSubagentTitle(
|
||||
Locale.titlecase(props.input.subagent_type ?? "General"),
|
||||
props.input.description,
|
||||
props.metadata.background === true,
|
||||
),
|
||||
]
|
||||
|
||||
const retrying = retry()
|
||||
if (isRunning() && retrying) {
|
||||
@@ -2266,6 +2270,10 @@ export function formatSubagentToolcalls(count: number) {
|
||||
return `${count} toolcall${count === 1 ? "" : "s"}`
|
||||
}
|
||||
|
||||
export function formatSubagentTitle(agent: string, description: string, background: boolean) {
|
||||
return `${agent} Task${background ? " (background)" : ""} — ${description}`
|
||||
}
|
||||
|
||||
export function formatCompletedSubagentDetail(toolcalls: number, duration: string) {
|
||||
if (toolcalls === 0) return duration
|
||||
return `${formatSubagentToolcalls(toolcalls)} · ${duration}`
|
||||
|
||||
Reference in New Issue
Block a user