feat: add experimental background subagents (#27084)

This commit is contained in:
Shoubhit Dash
2026-05-14 22:10:15 +05:30
committed by GitHub
parent bdb0c16a93
commit 22de34c4de
21 changed files with 976 additions and 102 deletions

View File

@@ -2013,7 +2013,9 @@ function Task(props: ToolProps<typeof TaskTool>) {
const content = createMemo(() => {
if (!props.input.description) return ""
let content = [`${Locale.titlecase(props.input.subagent_type ?? "General")} Task — ${props.input.description}`]
const description =
props.metadata.background === true ? `${props.input.description} (background)` : props.input.description
let content = [`${Locale.titlecase(props.input.subagent_type ?? "General")} Task — ${description}`]
if (isRunning() && tools().length > 0) {
// content[0] += ` · ${tools().length} toolcalls`
@@ -2025,7 +2027,11 @@ function Task(props: ToolProps<typeof TaskTool>) {
}
if (props.part.state.status === "completed") {
content.push(`${tools().length} toolcalls · ${Locale.duration(duration())}`)
content.push(
props.metadata.background === true
? `${tools().length} toolcalls`
: `${tools().length} toolcalls · ${Locale.duration(duration())}`,
)
}
return content.join("\n")