| 293 | } |
| 294 | |
| 295 | function taskStatus(part: ToolPart): FooterSubagentTab["status"] { |
| 296 | if (part.state.status === "completed") { |
| 297 | return "completed" |
| 298 | } |
| 299 | |
| 300 | if (part.state.status === "error") { |
| 301 | if (metadata(part, "interrupted") === true || text(part.state.error) === "Tool execution aborted") { |
| 302 | return "cancelled" |
| 303 | } |
| 304 | |
| 305 | return "error" |
| 306 | } |
| 307 | |
| 308 | return "running" |
| 309 | } |
| 310 | |
| 311 | function taskTab(part: ToolPart, sessionID: string): FooterSubagentTab { |
| 312 | const label = Locale.titlecase(text(part.state.input.subagent_type) ?? "general") |