Skip to content

fix(pr-review): use -F not -f for summary comment stdin body - #103

Merged
FeliLucero1 merged 2 commits into
mainfrom
fix/pr-review-summary-comment-stdin-flag
Jul 27, 2026
Merged

fix(pr-review): use -F not -f for summary comment stdin body#103
FeliLucero1 merged 2 commits into
mainfrom
fix/pr-review-summary-comment-stdin-flag

Conversation

@FeliLucero1

Copy link
Copy Markdown
Contributor

Summary

  • The review prompt told Claude to post the summary comment with gh api ... -f body=.... gh's @filename/@- stdin magic only works with -F (typed field), not -f (raw string) — so when Claude tried to stream the multi-line review body via -f body=@-, gh set the comment body to the literal two-character string @- instead.
  • Confirmed this happened for real on baton-aws (#132, #137), baton-okta, baton-servicenow, baton-sql, and baton-google-workspace — all posted a bot comment whose entire body is @-.
  • Fix: instruct -F body=@- <<'BODY_EOF' ... BODY_EOF (heredoc into a typed field), which does support stdin.

Test plan

  • Reproduced the exact bug and the fix against GitHub's stateless POST /markdown endpoint (no repo side effects): -f text=@- rendered as <p>@-</p>; -F text=@- rendered the actual heredoc content.
  • Confirm on the next real connector PR that the summary comment posts full review content instead of @-.

🤖 Generated with Claude Code

gh api's @filename/@- stdin magic only works with -F (typed field),
not -f (raw string). The prompt instructed -f body=@-, which set the
comment body to the literal two characters "@-" instead of streaming
the review text from stdin — reproduced live on baton-aws, baton-okta,
baton-servicenow, baton-sql, and baton-google-workspace.
@FeliLucero1
FeliLucero1 requested review from a team and ggreer July 24, 2026 02:56
@FeliLucero1 FeliLucero1 self-assigned this Jul 24, 2026
@FeliLucero1
FeliLucero1 requested a review from a team July 24, 2026 02:59
Comment thread .github/actions/pr-review/prompts/base-pr-review.md Outdated
BODY_EOF could plausibly appear as a line in a generated review body,
closing the heredoc early and feeding the remainder to the shell.

@sergiocorral-conductorone sergiocorral-conductorone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FeliLucero1
FeliLucero1 merged commit b01c222 into main Jul 27, 2026
2 checks passed
@FeliLucero1
FeliLucero1 deleted the fix/pr-review-summary-comment-stdin-flag branch July 27, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants