From 1987ba792dd9386bfbc41a1fd989219c74aa882d Mon Sep 17 00:00:00 2001 From: Felix Faerber Date: Sat, 4 Jul 2026 14:12:32 +0300 Subject: [PATCH] fix(activity-log): strip the PR-description block from the reasoning trail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'tool calls & reasoning' activity log dumped each text part verbatim, including the agent's BEGIN_PR_DESCRIPTION..END_PR_DESCRIPTION block — which is already published as the PR description, so it appeared twice (e.g. homelab PR #117). Strip that block from text parts, and drop a text entry that becomes empty after stripping. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/scripts/build-activity-log.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/scripts/build-activity-log.sh b/.gitea/workflows/scripts/build-activity-log.sh index ef266a5..bd92c51 100755 --- a/.gitea/workflows/scripts/build-activity-log.sh +++ b/.gitea/workflows/scripts/build-activity-log.sh @@ -13,7 +13,13 @@ jq -r ' def trunc(n): if length > n then (.[0:n] + "…") else . end; select(.type=="tool_use" or .type=="text") | if .type=="text" then - "💬 " + ((.part.text // "") | trunc(4000)) + # Drop the PR-description block from the reasoning trail — it is already published verbatim as + # the PR description, so repeating it here is redundant noise. Skip a text part that is nothing + # but that block (would otherwise be an empty "💬 " entry). + ((.part.text // "") + | gsub("BEGIN_PR_DESCRIPTION.*?END_PR_DESCRIPTION"; ""; "m") + | gsub("\\A[[:space:]]+|[[:space:]]+\\z"; "")) as $t | + if $t == "" then empty else "💬 " + ($t | trunc(4000)) end else (.part.tool // "?") as $t | ((.part.state.title // (.part.state.input | tojson | trunc(160)) // "")) as $title |