(client, sessionID, directory)
| 808 | continue; |
| 809 | if (part.type === "text" && typeof part.text === "string" && part.text.trim()) |
| 810 | return true; |
| 811 | if (["tool", "file", "patch", "artifact"].includes(String(part.type || ""))) |
| 812 | return true; |
| 813 | } |
| 814 | const info = message?.info || message || {}; |
| 815 | return [info.text, info.content, info.summary].some((value) => typeof value === "string" && value.trim()); |
| 816 | } |
| 817 | async function activeRunCompletionFromMessages(directory, client, sessionID, active) { |
| 818 | const messages = await readRecentSessionMessages(client, sessionID, directory); |
| 819 | if (!messages) |
| 820 | return "unknown"; |
| 821 | const ordered = orderedSessionMessages(messages); |
| 822 | const tail = ordered.at(-1); |
| 823 | const info = tail?.info || tail; |
| 824 | if (!info || info.role !== "assistant") |
| 825 | return "incomplete"; |
| 826 | const completed = Number(info?.time?.completed || 0); |
| 827 | const created = Number(info?.time?.created || 0); |
| 828 | if (!Number.isFinite(completed) || completed <= 0) |
| 829 | return "incomplete"; |
no test coverage detected