fix(activity-log): strip the PR-description block from the reasoning trail
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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a1ff1b9881
commit
1987ba792d
@@ -13,7 +13,13 @@ jq -r '
|
|||||||
def trunc(n): if length > n then (.[0:n] + "…") else . end;
|
def trunc(n): if length > n then (.[0:n] + "…") else . end;
|
||||||
select(.type=="tool_use" or .type=="text") |
|
select(.type=="tool_use" or .type=="text") |
|
||||||
if .type=="text" then
|
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
|
else
|
||||||
(.part.tool // "?") as $t |
|
(.part.tool // "?") as $t |
|
||||||
((.part.state.title // (.part.state.input | tojson | trunc(160)) // "")) as $title |
|
((.part.state.title // (.part.state.input | tojson | trunc(160)) // "")) as $title |
|
||||||
|
|||||||
Reference in New Issue
Block a user