From 0a89309ff131f606009d0922a78ca935e2eabb7e Mon Sep 17 00:00:00 2001 From: Felix Faerber Date: Sat, 4 Jul 2026 14:40:59 +0300 Subject: [PATCH] =?UTF-8?q?fix(activity-log):=20tool=20calls=20only=20?= =?UTF-8?q?=E2=80=94=20drop=20the=20agent's=20prose=20summary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The activity
was labelled 'tool calls & reasoning' but included the agent's final prose summary ('Added the whoami service... Exposed via Traefik... Pushed to branch...'), which is just a restatement of the PR description and not a tool call. Emit only tool_use events; relabel to 'N tool calls'. The what-changed narrative lives in the PR description; this section is the record of actions taken. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../workflows/scripts/build-activity-log.sh | 28 +++++++------------ .gitea/workflows/scripts/publish.sh | 2 +- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/scripts/build-activity-log.sh b/.gitea/workflows/scripts/build-activity-log.sh index bd92c51..5349690 100755 --- a/.gitea/workflows/scripts/build-activity-log.sh +++ b/.gitea/workflows/scripts/build-activity-log.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash -# Build activity log (tool calls + reasoning) from the event stream into /tmp/activity_log.md. -# Only dev agents (mode=pr) get an activity-log comment — comment-only roles (pm/qa) -# do no tool calls, so a trail would be empty/noise. +# Build the activity log — the list of TOOL CALLS the agent made — into /tmp/activity_log.md. +# Only dev agents (mode=pr) get an activity-log comment — comment-only roles (pm/qa) do no tool calls. +# NOTE: we deliberately DO NOT include the agent's prose text parts. That final "here's what I did" +# text is just a restatement of the PR description (already published as the PR body), not a tool +# call — so it was noise in a section titled "tool calls". The log is the record of ACTIONS taken. # # Required env (provided by the workflow step): MODE set -u @@ -11,22 +13,12 @@ if [ "$MODE" != "pr" ]; then fi jq -r ' def trunc(n): if length > n then (.[0:n] + "…") else . end; - select(.type=="tool_use" or .type=="text") | - if .type=="text" then - # 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 | - "🔧 **" + $t + "**: `" + ($title | trunc(240)) + "`" - end + select(.type=="tool_use") | + (.part.tool // "?") as $t | + ((.part.state.title // (.part.state.input | tojson | trunc(160)) // "")) as $title | + "🔧 **" + $t + "**: `" + ($title | trunc(240)) + "`" ' /tmp/events.jsonl > /tmp/activity_log.md 2>/dev/null || true n=$(wc -l < /tmp/activity_log.md 2>/dev/null || echo 0) -echo "activity log: $n entries" +echo "activity log: $n tool calls" [ "$n" -eq 0 ] && : > /tmp/activity_log.md head -3 /tmp/activity_log.md diff --git a/.gitea/workflows/scripts/publish.sh b/.gitea/workflows/scripts/publish.sh index ba3eca8..a0d93f5 100755 --- a/.gitea/workflows/scripts/publish.sh +++ b/.gitea/workflows/scripts/publish.sh @@ -144,7 +144,7 @@ activity="" if [ -s /tmp/activity_log.md ]; then entries=$(wc -l < /tmp/activity_log.md 2>/dev/null || echo 0) log=$(cat /tmp/activity_log.md) - activity=$(printf '\n\n
\n🔧 activity — %s tool calls & reasoning\n\n%s\n\n
' "$entries" "$log") + activity=$(printf '\n\n
\n🔧 activity — %s tool calls\n\n%s\n\n
' "$entries" "$log") fi # One PR per run: publish ONLY this run's own branch ($BRANCH), never sibling