fix: log Claude output diagnostics on no_push failure
Some checks failed
ci/woodpecker/push/ci Pipeline failed

Save agent_run output to agent-run-last.json. On no_push, log the
result text, turn count, and cost. Save full output to
no-push-{issue}-{ts}.json for later analysis.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
johba 2026-03-28 23:03:17 +00:00
parent 06da075505
commit 59b4cafcfc
2 changed files with 17 additions and 0 deletions

View file

@ -58,4 +58,9 @@ agent_run() {
printf '%s' "$new_sid" > "$SID_FILE"
log "agent_run: session_id=${new_sid:0:12}..."
fi
# Save output for diagnostics (no_push, crashes)
_AGENT_LAST_OUTPUT="$output"
local diag_file="${DISINTO_LOG_DIR:-/tmp}/dev/agent-run-last.json"
printf '%s' "$output" > "$diag_file" 2>/dev/null || true
}