Repository navigation
fix(post-pr-review): insert verdict findings into fix-request comment - #207
Conversation
The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No description provided. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7eb0bf185
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Code Review
This pull request updates the scripts/post-pr-review.sh script to dynamically insert review findings into the automated PR comment using the $BODY variable. Feedback was provided to handle cases where the $BODY variable might contain the literal string "null" by implementing a fallback message to improve clarity for the user.
|
No description provided. |
Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af4bd80f89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
No description provided. |
|
@donpetry-bot - please review |
The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
|
No description provided. |
|
No description provided. |
|
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: bb7b21312643c3f137378459e355a86b2211deee
Review mode: triage-approved (single reviewer)
Summary
Small, well-scoped bash fix in scripts/post-pr-review.sh (+8/-2, 1 file). Addresses three issues:
- Root bug — Replaces the literal placeholder
[Findings would be inserted here]with$BODY_FOR_COMMENTso cascade findings actually appear in fix-request comments. - Null-body guard (Gemini) —
jq -r '.body'returned the literal string"null"when the verdict JSON lacked a body field; switched to.body // "". - Duplicate marker (Codex P2) — The verdict body already carries its own
<!-- pr-review-agent v1 sha=… -->marker; embedding it inside the fix-request heredoc produced two markers per comment, causingreview-one-pr.sh'sgrep -cto count one delegated cycle as two and prematurely trip the max-cycle cap. Now stripped withsedbefore insertion.
The final commit (bb7b213) corrects the sed pattern: the earlier [a-f0-9]* --[^>]*--> required a literal -- after the SHA that doesn't exist in the actual marker format. The new [a-f0-9][^>]*--> correctly matches <!-- pr-review-agent v1 sha=<hex> [decision=… risk=…] -->.
Linked issue analysis
No Fixes # link, but the PR body cites the observed symptom — combsmith/.github#302 comment 4468656929 showed a cycle-2/3 fix-request with blank findings. The fix substantively addresses that observation.
Findings
No blocking issues.
- Heredoc safety:
$BODY_FOR_COMMENTis inserted into an unquoted heredoc. Bash expands$VARreferences but does not re-evaluate the substituted content, so literal$(...)or backticks inside the review body are inserted as text — no command-injection risk from review-body contents. - Sed pattern correctness:
[a-f0-9][^>]*-->requires at least one hex char aftersha=(preventing matches onsha= -->) and stops at the first>, so it cannot run away into surrounding markdown. Correctly matches both the bare-SHA form and the decision/risk form. - Approve-path parity: Line 182 (
echo "$BODY" > "$BODY_FILE") already used the body verbatim with the embedded marker. With the null-guard now applied at extraction (line 34), the approve path is also protected from null-body writes — a small, free improvement.
CI status
All required checks green: CodeQL, SonarCloud (quality gate passed), AgentShield, shellcheck, bats, unit-tests, dependency-audit. CodeRabbit APPROVED on the reviewed SHA.
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.
…#207) * fix(post-pr-review): insert verdict body into fix-request comment The escalate+AI-delegation path built its comment from a static heredoc with a literal '[Findings would be inserted here]' placeholder. $BODY (already extracted from the verdict JSON on line 34) was never referenced in this path — only the approve path used it correctly. Replace the placeholder with $BODY so the cascade's actual findings appear in every fix-request comment. * fix(post-pr-review): guard null body and strip duplicate markers Address two reviewer findings on PR #207: 1. (Gemini) `jq -r '.body'` returns the literal string "null" when the verdict JSON lacks a body field. Switch to `.body // ""` so the approve path writes an empty string and the fix-request comment shows nothing rather than "null". 2. (Codex P2) The cascade-action body already contains a `<!-- pr-review-agent v1 sha=... -->` marker. Embedding it verbatim inside the fix-request heredoc produces two markers per comment; review-one-pr.sh counts matching lines with grep -c, so one delegated cycle was counted as two and could prematurely trip the max-cycle human-escalation cap. Strip embedded markers from BODY before inserting. * fix(post-pr-review): correct sed pattern for stripping embedded markers The previous pattern `[a-f0-9]* --[^>]*-->` required a literal `--` immediately after the SHA, but the actual marker format is `sha=<hex> -->` or `sha=<hex> decision=... -->` — no leading `--` before the non-`>` content. The strip never fired, leaving the embedded marker intact and still double-counting review cycles. Fix: use `[a-f0-9][^>]*-->` which matches the SHA start then any non-`>` chars up to the closing `-->`.



Summary
escalate+AI-delegation path inpost-pr-review.shbuilt its comment from a static heredoc with a literal[Findings would be inserted here]placeholder$BODY(extracted from the verdict JSON on line 34) was already available but never referenced in this code path — only theapprovepath used it correctlyRoot cause
Fix
Replace
[Findings would be inserted here]with$BODYin the heredoc. The heredoc delimiter is unquoted (COMMENT_END) so shell variable expansion already fires — this is a one-line change.Observed symptom
combsmith/.github#302 comment #4468656929 — cycle 2/3 fix-request with blank findings.
🤖 Generated with Claude Code