|
|
@@ -1799,9 +1799,19 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
|
|
const keybind = useKeybind()
|
|
|
const { navigate } = useRoute()
|
|
|
const local = useLocal()
|
|
|
+ const sync = useSync()
|
|
|
+
|
|
|
+ const tools = createMemo(() => {
|
|
|
+ const sessionID = props.metadata.sessionId
|
|
|
+ const msgs = sync.data.message[sessionID ?? ""] ?? []
|
|
|
+ return msgs.flatMap((msg) =>
|
|
|
+ (sync.data.part[msg.id] ?? [])
|
|
|
+ .filter((part): part is ToolPart => part.type === "tool")
|
|
|
+ .map((part) => ({ tool: part.tool, state: part.state })),
|
|
|
+ )
|
|
|
+ })
|
|
|
|
|
|
- const current = createMemo(() => props.metadata.summary?.findLast((x) => x.state.status !== "pending"))
|
|
|
- const color = createMemo(() => local.agent.color(props.input.subagent_type ?? "unknown"))
|
|
|
+ const current = createMemo(() => tools().findLast((x) => x.state.status !== "pending"))
|
|
|
|
|
|
return (
|
|
|
<Switch>
|
|
|
@@ -1817,13 +1827,17 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
|
|
>
|
|
|
<box>
|
|
|
<text style={{ fg: theme.textMuted }}>
|
|
|
- {props.input.description} ({props.metadata.summary?.length ?? 0} toolcalls)
|
|
|
+ {props.input.description} ({tools().length} toolcalls)
|
|
|
</text>
|
|
|
<Show when={current()}>
|
|
|
- <text style={{ fg: current()!.state.status === "error" ? theme.error : theme.textMuted }}>
|
|
|
- └ {Locale.titlecase(current()!.tool)}{" "}
|
|
|
- {current()!.state.status === "completed" ? current()!.state.title : ""}
|
|
|
- </text>
|
|
|
+ {(item) => {
|
|
|
+ const title = item().state.status === "completed" ? (item().state as any).title : ""
|
|
|
+ return (
|
|
|
+ <text style={{ fg: item().state.status === "error" ? theme.error : theme.textMuted }}>
|
|
|
+ └ {Locale.titlecase(item().tool)} {title}
|
|
|
+ </text>
|
|
|
+ )
|
|
|
+ }}
|
|
|
</Show>
|
|
|
</box>
|
|
|
<Show when={props.metadata.sessionId}>
|