@@ -1799,9 +1799,19 @@ function Task(props: ToolProps<typeof TaskTool>) {
17991799 const keybind = useKeybind ( )
18001800 const { navigate } = useRoute ( )
18011801 const local = useLocal ( )
1802+ const sync = useSync ( )
1803+
1804+ const tools = createMemo ( ( ) => {
1805+ const sessionID = props . metadata . sessionId
1806+ const msgs = sync . data . message [ sessionID ?? "" ] ?? [ ]
1807+ return msgs . flatMap ( ( msg ) =>
1808+ ( sync . data . part [ msg . id ] ?? [ ] )
1809+ . filter ( ( part ) : part is ToolPart => part . type === "tool" )
1810+ . map ( ( part ) => ( { tool : part . tool , state : part . state } ) ) ,
1811+ )
1812+ } )
18021813
1803- const current = createMemo ( ( ) => props . metadata . summary ?. findLast ( ( x ) => x . state . status !== "pending" ) )
1804- const color = createMemo ( ( ) => local . agent . color ( props . input . subagent_type ?? "unknown" ) )
1814+ const current = createMemo ( ( ) => tools ( ) . findLast ( ( x ) => x . state . status !== "pending" ) )
18051815
18061816 return (
18071817 < Switch >
@@ -1817,13 +1827,17 @@ function Task(props: ToolProps<typeof TaskTool>) {
18171827 >
18181828 < box >
18191829 < text style = { { fg : theme . textMuted } } >
1820- { props . input . description } ({ props . metadata . summary ?. length ?? 0 } toolcalls)
1830+ { props . input . description } ({ tools ( ) . length } toolcalls)
18211831 </ text >
18221832 < Show when = { current ( ) } >
1823- < text style = { { fg : current ( ) ! . state . status === "error" ? theme . error : theme . textMuted } } >
1824- └ { Locale . titlecase ( current ( ) ! . tool ) } { " " }
1825- { current ( ) ! . state . status === "completed" ? current ( ) ! . state . title : "" }
1826- </ text >
1833+ { ( item ) => {
1834+ const title = item ( ) . state . status === "completed" ? ( item ( ) . state as any ) . title : ""
1835+ return (
1836+ < text style = { { fg : item ( ) . state . status === "error" ? theme . error : theme . textMuted } } >
1837+ └ { Locale . titlecase ( item ( ) . tool ) } { title }
1838+ </ text >
1839+ )
1840+ } }
18271841 </ Show >
18281842 </ box >
18291843 < Show when = { props . metadata . sessionId } >
0 commit comments