Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ui-tui/src/components/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,21 @@ export function Message({ entry }: { entry: TranscriptEntry }): React.ReactEleme
if (entry.todos) {
return <TodoList todos={entry.todos} />
}
// Agent/Task (subagent spawn) renders as a Task card.
if (entry.agent) {
const a = entry.agent
const label = a.name ? `${a.description} (@${a.name})` : a.description
return (
<Text>
<Text color={theme.suggestion}>⏺ </Text>
<Text bold>Task</Text>
<Text color={theme.dim}>(</Text>
<Text color={theme.suggestion}>{label}</Text>
<Text color={theme.dim}>)</Text>
{a.subagentType ? <Text color={theme.dim}>{` · ${a.subagentType}`}</Text> : null}
</Text>
)
}
// Collapsed summary of several same-kind calls (e.g. "Read 4 files").
if (entry.count && entry.count > 1) {
const noun = TOOL_VERB[entry.toolName ?? '']?.noun || 'files'
Expand Down
18 changes: 18 additions & 0 deletions ui-tui/src/sdkMessageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export interface TranscriptEntry {
todos?: TodoItem[]
/** /context entries: the context-window usage breakdown to visualize. */
contextData?: ContextData
/** Agent/Task tool calls: the spawned subagent's task + type. */
agent?: { description: string; subagentType: string; name: string }
/** banner only: the session info snapshot, captured once at init. */
bannerData?: { model: string; mode: string; tools: number; cwd?: string }
}
Expand Down Expand Up @@ -171,6 +173,22 @@ export function messageToEntries(msg: ServerMessage): TranscriptEntry[] {
string,
unknown
>
// Agent/Task (subagent spawn) renders as a Task card.
if (toolName === 'Agent' || toolName === 'Task') {
out.push({
id: nextId(),
kind: 'tool',
text: '',
toolName,
agent: {
description: String(tinput['description'] ?? ''),
subagentType: String(tinput['subagent_type'] ?? ''),
name: String(tinput['name'] ?? ''),
},
toolUseId: String((block as { id?: string }).id ?? ''),
})
continue
}
// TodoWrite renders as a checklist, not a generic tool call.
if (toolName === 'TodoWrite' && Array.isArray(tinput['todos'])) {
out.push({
Expand Down