Merge pull request #465 from samdickson22/sam/eng-1893-show-subagent-name

Display subagent names instead of generic 'Task' label
This commit is contained in:
Dex
2025-08-19 16:23:47 -07:00
committed by GitHub
2 changed files with 11 additions and 4 deletions

View File

@@ -128,9 +128,10 @@ export function eventToDisplayObject(
if (event.toolName === 'Task') {
const toolInput = JSON.parse(event.toolInputJson!)
const displayName = toolInput.subagent_type || 'Task'
subject = (
<span>
<span className="font-bold">{event.toolName} </span>
<span className="font-bold">{displayName} </span>
<span className="font-mono text-sm text-muted-foreground">{toolInput.description}</span>
</span>
)

View File

@@ -54,7 +54,9 @@ export function TaskGroup({
shouldIgnoreMouseEvent,
}: TaskGroupProps) {
const { parentTask, toolCallCount, latestEvent, hasPendingApproval } = group
const description = JSON.parse(parentTask.toolInputJson || '{}').description || 'Task'
const taskInput = JSON.parse(parentTask.toolInputJson || '{}')
const displayName = taskInput.subagent_type || 'Task'
const description = taskInput.description || 'Task'
const isCompleted = parentTask.isCompleted
return (
@@ -95,7 +97,10 @@ export function TaskGroup({
<div className="flex-1">
<div className="flex items-center gap-2">
<Wrench className="w-4 h-4 text-accent" />
<span className="font-medium">{truncate(description, 80)}</span>
<div className="text-sm text-muted-foreground">
<span className="font-semibold">{displayName}: </span>
{description}
</div>
{!isCompleted && <CircleDashed className="w-4 h-4 animate-spin text-muted-foreground" />}
{hasPendingApproval && (
<span className="text-xs bg-warning/20 text-warning px-2 py-0.5 rounded">
@@ -126,7 +131,8 @@ export function TaskGroup({
} else if (latestEvent.toolName === 'Bash' && toolInput.command) {
previewText = `$ ${truncate(toolInput.command, 50)}`
} else if (latestEvent.toolName === 'Task' && toolInput.description) {
previewText = truncate(toolInput.description, 80)
const taskName = toolInput.subagent_type ? toolInput.subagent_type + ': ' : ''
previewText = taskName + truncate(toolInput.description, 80 - taskName.length)
}
} catch {
// Keep default preview text if JSON parsing fails