From e5273efdeb48f2876e8e3717d668237128ca92d1 Mon Sep 17 00:00:00 2001 From: Alexander Amiri Date: Mon, 16 Mar 2026 21:57:34 +0100 Subject: [PATCH] Fix double review output in CI logs, add agent guideline - extract-review-risk.sh: replace tee (writes to stdout + file simultaneously) with redirect-then-cat (write to file, print once) - CLAUDE.md: add guideline to check PR state before pushing --- CLAUDE.md | 1 + scripts/extract-review-risk.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9c2f149..cc54f6e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -299,3 +299,4 @@ When working on any task: 4. Never push without the user's confirmation 5. Never implement hacky solutions — generalize 6. Update task status in this file when complete +7. **Always check PR state before pushing to a branch** — run `gh pr view` to verify the PR is still open. The user may have already merged it. Pushing to a merged branch creates orphaned commits. diff --git a/scripts/extract-review-risk.sh b/scripts/extract-review-risk.sh index 286c74e..e4d955d 100644 --- a/scripts/extract-review-risk.sh +++ b/scripts/extract-review-risk.sh @@ -11,7 +11,8 @@ set -e REVIEW_SCRIPT="$1" PLAN_FILE="$2" -python3 "$REVIEW_SCRIPT" "$PLAN_FILE" 2>&1 | tee review-output.txt || true +python3 "$REVIEW_SCRIPT" "$PLAN_FILE" > review-output.txt 2>&1 || true +cat review-output.txt if [ -f review-result.json ]; then RISK=$(jq -r '.risk // "FAILED"' review-result.json)