From 0cd44e50dd36c4b7357539419f1feb0bb25404ef Mon Sep 17 00:00:00 2001 From: Andrew Munsell Date: Sun, 1 Jun 2025 18:33:02 -0700 Subject: [PATCH] fix: Update condition for final message in output (#106) The last message in the Claude Code output does not have a role, but instead has a field "type" set to "result". With the current condition, the duration is never appended to the header of the comments. --- src/entrypoints/update-comment-link.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entrypoints/update-comment-link.ts b/src/entrypoints/update-comment-link.ts index 40c20ad..2dfd8c9 100644 --- a/src/entrypoints/update-comment-link.ts +++ b/src/entrypoints/update-comment-link.ts @@ -166,7 +166,7 @@ async function run() { if (Array.isArray(outputData) && outputData.length > 0) { const lastElement = outputData[outputData.length - 1]; if ( - lastElement.role === "system" && + lastElement.type === "result" && "cost_usd" in lastElement && "duration_ms" in lastElement ) {