(data: SessionData, part: ToolPart)
| 375 | // When that happens, drop the recovered pending request tied to this tool call so |
| 376 | // the footer can return to the next blocker or to the prompt. |
| 377 | function syncQuestion(data: SessionData, part: ToolPart): FooterOutput | undefined { |
| 378 | if (part.tool !== "question") { |
| 379 | return undefined |
| 380 | } |
| 381 | |
| 382 | if (part.state.status !== "completed" && part.state.status !== "error") { |
| 383 | return undefined |
| 384 | } |
| 385 | |
| 386 | const next = data.questions.filter( |
| 387 | (request) => request.tool?.messageID !== part.messageID || request.tool?.callID !== part.callID, |
| 388 | ) |
| 389 | if (next.length === data.questions.length) { |
| 390 | return undefined |
| 391 | } |
| 392 | |
| 393 | data.questions = next |
| 394 | return queueFooter(data) |
| 395 | } |
| 396 | |
| 397 | function toolStatus(part: ToolPart): string { |
| 398 | if (part.tool !== "task") { |
no test coverage detected