Skip to content

ci(comment-length-review): committable inline suggestions as workweave-bot - #645

Merged
steventohme merged 1 commit into
mainfrom
steven/comment-length-suggestions
Jul 6, 2026
Merged

ci(comment-length-review): committable inline suggestions as workweave-bot#645
steventohme merged 1 commit into
mainfrom
steven/comment-length-suggestions

Conversation

@steventohme

Copy link
Copy Markdown
Collaborator

What

Fixes the advisory comment-length reviewer so it posts actual inline review comments (not one summary dump), authored by workweave-bot.

Why

On main (#592) the reviewer drives inline comments through the action's mcp__github_inline_comment__create_inline_comment tool, but the @beta claude-code-action doesn't expose that tool. At runtime the model reported "inline comment tool unavailable" and fell back to posting every finding in one issue comment (e.g. #644).

Changes

  • Committable inline suggestions — post via the working gh api POST .../reviews path. Each comment is a real GitHub ```suggestion block spanning the whole comment block (start_line..line), so the shortened comment is one-click committable.
  • workweave-bot authorship — run the gh api call under WEAVE_BOT_TOKEN (PAT) instead of GITHUB_TOKEN, which stamped every comment github-actions[bot].

Still advisory: event=COMMENT, never REQUEST_CHANGES, no required status check registered.

Note

Requires WEAVE_BOT_TOKEN to have pull_requests: write on this repo (fine-grained) or classic repo scope.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown

T-Rex T-Rex Logs

What T-Rex did

  • The PR tool boundary verifier was reproduced, confirming the workflow uses anthropics/claude-code-action@beta with allowed_tools including Bash(gh api:*), reads the PR diff via git diff, and posts a review via gh api, with GH_TOKEN bound to WEAVE_BOT_TOKEN in the step environment and gh installed and available without live GitHub API calls.
  • The standalone verification script was executed to validate the comment-length review flow; the run exited with code 0 and PASS results for endpoint, COMMENT event, suggestion block, and required payload fields, and live authorship posting was intentionally not performed in the sandbox.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "ci(comment-length-review): committable i..." | Re-trigger Greptile

Comment thread .github/workflows/comment_length_review.yml
…e-bot

Two fixes to the advisory comment-length reviewer:

- Emit real committable GitHub ```suggestion``` blocks spanning the whole
  comment block (start_line..line) so the shortened comment is one-click
  committable, instead of an illustrative fenced snippet. Posted via the
  working `gh api` reviews path (the beta action does not expose
  mcp__github_inline_comment__create_inline_comment, which failed at runtime
  and posted nothing).
- Author the comments as the workweave-bot account by running the gh api call
  under the WEAVE_BOT_TOKEN PAT instead of GITHUB_TOKEN, which stamped every
  comment github-actions[bot].

Still advisory: event=COMMENT, never REQUEST_CHANGES, no required status check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@steventohme
steventohme force-pushed the steven/comment-length-suggestions branch from c5456c9 to 560a255 Compare July 6, 2026 17:46
@steventohme
steventohme enabled auto-merge (squash) July 6, 2026 17:47
@steventohme
steventohme merged commit f976397 into main Jul 6, 2026
9 checks passed
@steventohme
steventohme deleted the steven/comment-length-suggestions branch July 6, 2026 17:49

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 560a255. Configure here.

"body": "```suggestion\n\t// bar does X because Y.\n```\nWas 8 lines restating the code; the WHY fits in one."}
]
}
JSON

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Heredoc terminator invalid in example

Medium Severity

The direct_prompt example for posting reviews uses a bash &lt;&lt;'JSON' heredoc whose closing JSON line is indented like the surrounding YAML. Bash only accepts the closing delimiter at the start of the line, so a command copied from that example never ends the heredoc and gh api --input - gets broken or incomplete JSON instead of a review payload.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 560a255. Configure here.

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.

1 participant