Stream thinking and text from Claude

This commit is contained in:
2026-07-21 02:30:22 +09:00
parent 66ee427697
commit a791bc7033
+1 -1
View File
@@ -41,7 +41,7 @@ STREAM_FILE="$(mktemp)"
claude --print --dangerously-skip-permissions \ claude --print --dangerously-skip-permissions \
--output-format stream-json --verbose "${FINAL_PROMPT}" \ --output-format stream-json --verbose "${FINAL_PROMPT}" \
| tee "${STREAM_FILE}" \ | tee "${STREAM_FILE}" \
| jq -r --unbuffered '[.type, (.message.content[]?.name // empty)] | join(" ")' | jq -r --unbuffered '.message.content[]? | .thinking // .text // .name // empty'
jq -r 'select(.type == "result") | .result // ("Bot failed: " + .subtype)' "${STREAM_FILE}" \ jq -r 'select(.type == "result") | .result // ("Bot failed: " + .subtype)' "${STREAM_FILE}" \
| ansifilter > "${COMMENT_FILE}" | ansifilter > "${COMMENT_FILE}"