@@ -162,6 +162,9 @@ const TaskId: React.FC<{ id: string; className?: string }> = ({ id, className })
162162// TASK TOOL CALL (spawn sub-agent)
163163// ═══════════════════════════════════════════════════════════════════════════════
164164
165+ function isBashTaskArgs ( args : TaskToolArgs ) : args is Extract < TaskToolArgs , { kind : "bash" } > {
166+ return ( args as { kind ?: unknown } ) . kind === "bash" ;
167+ }
165168interface TaskToolCallProps {
166169 args : TaskToolArgs ;
167170 result ?: TaskToolSuccessResult ;
@@ -174,27 +177,44 @@ export const TaskToolCall: React.FC<TaskToolCallProps> = ({ args, result, status
174177 const { expanded, toggleExpanded } = useToolExpansion ( hasReport ) ;
175178
176179 const isBackground = args . run_in_background ?? false ;
177- const agentType = args . subagent_type ;
178- const prompt = args . prompt ;
179- const title = args . title ;
180+
181+ let isBashTask : boolean ;
182+ let title : string ;
183+ let promptOrScript : string ;
184+ let kindBadge : React . ReactNode ;
185+
186+ if ( isBashTaskArgs ( args ) ) {
187+ isBashTask = true ;
188+ title = args . display_name ;
189+ promptOrScript = args . script ;
190+ kindBadge = < AgentTypeBadge type = "bash" /> ;
191+ } else {
192+ isBashTask = false ;
193+ title = args . title ;
194+ promptOrScript = args . prompt ;
195+ kindBadge = < AgentTypeBadge type = { args . subagent_type } /> ;
196+ }
180197
181198 // Derive task state from result
182199 const taskId = result ?. taskId ;
183200 const taskStatus = result ?. status ;
184201 const reportMarkdown = result ?. status === "completed" ? result . reportMarkdown : undefined ;
185202 const reportTitle = result ?. status === "completed" ? result . title : undefined ;
203+ const exitCode = result ?. status === "completed" ? result . exitCode : undefined ;
186204
187- // Show preview of prompt (first line or truncated)
188- const promptPreview =
189- prompt . length > 60 ? prompt . slice ( 0 , 60 ) . trim ( ) + "…" : prompt . split ( "\n" ) [ 0 ] ;
205+ // Show preview (first line or truncated)
206+ const preview =
207+ promptOrScript . length > 60
208+ ? promptOrScript . slice ( 0 , 60 ) . trim ( ) + "…"
209+ : promptOrScript . split ( "\n" ) [ 0 ] ;
190210
191211 return (
192212 < ToolContainer expanded = { expanded } >
193213 < ToolHeader onClick = { toggleExpanded } >
194214 < ExpandIcon expanded = { expanded } > ▶</ ExpandIcon >
195215 < TaskIcon toolName = "task" />
196216 < ToolName > task</ ToolName >
197- < AgentTypeBadge type = { agentType } />
217+ { kindBadge }
198218 { isBackground && (
199219 < span className = "text-backgrounded text-[10px] font-medium" > background</ span >
200220 ) }
@@ -205,26 +225,33 @@ export const TaskToolCall: React.FC<TaskToolCallProps> = ({ args, result, status
205225 < ToolDetails >
206226 { /* Task info surface */ }
207227 < div className = "task-surface mt-1 rounded-md p-3" >
208- < div className = "task-divider mb-2 flex items-center gap-2 border-b pb-2" >
228+ < div className = "task-divider mb-2 flex flex-wrap items-center gap-2 border-b pb-2" >
209229 < span className = "text-task-mode text-[12px] font-semibold" >
210230 { reportTitle ?? title }
211231 </ span >
212232 { taskId && < TaskId id = { taskId } /> }
213233 { taskStatus && < TaskStatusBadge status = { taskStatus } /> }
234+ { exitCode !== undefined && (
235+ < span className = "text-muted text-[10px]" > exit { exitCode } </ span >
236+ ) }
214237 </ div >
215238
216- { /* Prompt section */ }
239+ { /* Prompt / script */ }
217240 < div className = "mb-2" >
218- < div className = "text-muted mb-1 text-[10px] tracking-wide uppercase" > Prompt</ div >
219- < div className = "text-foreground bg-code-bg max-h-[100px] overflow-y-auto rounded-sm p-2 text-[11px] break-words whitespace-pre-wrap" >
220- { prompt }
241+ < div className = "text-muted mb-1 text-[10px] tracking-wide uppercase" >
242+ { isBashTask ? "Script" : "Prompt" }
243+ </ div >
244+ < div className = "text-foreground bg-code-bg max-h-[140px] overflow-y-auto rounded-sm p-2 text-[11px] break-words whitespace-pre-wrap" >
245+ { promptOrScript }
221246 </ div >
222247 </ div >
223248
224249 { /* Report section */ }
225250 { reportMarkdown && (
226251 < div className = "task-divider border-t pt-2" >
227- < div className = "text-muted mb-1 text-[10px] tracking-wide uppercase" > Report</ div >
252+ < div className = "text-muted mb-1 text-[10px] tracking-wide uppercase" >
253+ { isBashTask ? "Output" : "Report" }
254+ </ div >
228255 < div className = "text-[11px]" >
229256 < MarkdownRenderer content = { reportMarkdown } />
230257 </ div >
@@ -243,7 +270,7 @@ export const TaskToolCall: React.FC<TaskToolCallProps> = ({ args, result, status
243270 ) }
244271
245272 { /* Collapsed preview */ }
246- { ! expanded && < div className = "text-muted mt-1 truncate text-[10px]" > { promptPreview } </ div > }
273+ { ! expanded && < div className = "text-muted mt-1 truncate text-[10px]" > { preview } </ div > }
247274 </ ToolContainer >
248275 ) ;
249276} ;
@@ -270,6 +297,12 @@ export const TaskAwaitToolCall: React.FC<TaskAwaitToolCallProps> = ({
270297 const timeoutSecs = args . timeout_secs ;
271298 const results = result ?. results ?? [ ] ;
272299
300+ const showConfigInfo =
301+ taskIds !== undefined ||
302+ timeoutSecs !== undefined ||
303+ args . filter !== undefined ||
304+ args . filter_exclude === true ;
305+
273306 // Summary for header
274307 const completedCount = results . filter ( ( r ) => r . status === "completed" ) . length ;
275308 const totalCount = results . length ;
@@ -292,10 +325,12 @@ export const TaskAwaitToolCall: React.FC<TaskAwaitToolCallProps> = ({
292325 < ToolDetails >
293326 < div className = "task-surface mt-1 rounded-md p-3" >
294327 { /* Config info */ }
295- { ( taskIds ?? timeoutSecs ) && (
328+ { showConfigInfo && (
296329 < div className = "task-divider text-muted mb-2 flex flex-wrap gap-2 border-b pb-2 text-[10px]" >
297- { taskIds && < span > Waiting for: { taskIds . length } task(s)</ span > }
298- { timeoutSecs && < span > Timeout: { timeoutSecs } s</ span > }
330+ { taskIds !== undefined && < span > Waiting for: { taskIds . length } task(s)</ span > }
331+ { timeoutSecs !== undefined && < span > Timeout: { timeoutSecs } s</ span > }
332+ { args . filter !== undefined && < span > Filter: { args . filter } </ span > }
333+ { args . filter_exclude === true && < span > Exclude: true</ span > }
299334 </ div >
300335 ) }
301336
@@ -329,20 +364,35 @@ const TaskAwaitResult: React.FC<{
329364 const reportMarkdown = isCompleted ? result . reportMarkdown : undefined ;
330365 const title = isCompleted ? result . title : undefined ;
331366
367+ const output = "output" in result ? result . output : undefined ;
368+ const note = "note" in result ? result . note : undefined ;
369+ const exitCode = "exitCode" in result ? result . exitCode : undefined ;
370+ const elapsedMs = "elapsed_ms" in result ? result . elapsed_ms : undefined ;
371+
332372 return (
333373 < div className = "bg-code-bg rounded-sm p-2" >
334- < div className = "mb-1 flex items-center gap-2" >
374+ < div className = "mb-1 flex flex-wrap items-center gap-2" >
335375 < TaskId id = { result . taskId } />
336376 < TaskStatusBadge status = { result . status } />
337377 { title && < span className = "text-foreground text-[11px] font-medium" > { title } </ span > }
378+ { exitCode !== undefined && < span className = "text-muted text-[10px]" > exit { exitCode } </ span > }
379+ { elapsedMs !== undefined && < span className = "text-muted text-[10px]" > { elapsedMs } ms</ span > }
338380 </ div >
339381
382+ { ! isCompleted && output && output . length > 0 && (
383+ < div className = "text-foreground bg-code-bg max-h-[140px] overflow-y-auto rounded-sm p-2 text-[11px] break-words whitespace-pre-wrap" >
384+ { output }
385+ </ div >
386+ ) }
387+
340388 { reportMarkdown && (
341389 < div className = "mt-2 text-[11px]" >
342390 < MarkdownRenderer content = { reportMarkdown } />
343391 </ div >
344392 ) }
345393
394+ { note && < div className = "text-muted mt-1 text-[10px]" > { note } </ div > }
395+
346396 { "error" in result && result . error && (
347397 < div className = "text-danger mt-1 text-[11px]" > { result . error } </ div >
348398 ) }
0 commit comments