Improve Bonk to read triggering comments and act on fixup requests#13147
Improve Bonk to read triggering comments and act on fixup requests#13147
Conversation
Bonk was ignoring the triggering comment when invoked via /bonk, defaulting to a generic PR review instead of acting on the specific request. Three changes: 1. Inject the triggering comment body into Bonk's context via the workflow prompt parameter, so Bonk actually sees what was asked. 2. Restructure the agent prompt to prioritize the triggering comment as the task definition, with new non-negotiable rules and a task-first implementation workflow. 3. Raise the auto-reviewer's LGTM threshold with an explicit not-actionable list to reduce noise on new PRs.
|
|
LGTM |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
There was a problem hiding this comment.
Changes look good. The comment body is correctly passed through an environment variable (COMMENT_BODY) to avoid script injection, which is the right pattern. The heredoc delimiter EOF is used both as the output boundary and appears literally in the echo — if a comment body ever contained a line that is exactly EOF on its own it would truncate the output early, but that's an edge case that's unlikely to matter in practice and is consistent with how the review workflow handles its prompt.
Two small notes (non-blocking):
-
PR description mentions
bonk_reviewer.mdchanges that aren't in the diff — the description says the LGTM threshold was raised with an explicit "not actionable" list, but no changes to.github/bonk_reviewer.mdare included. Might be worth either adding those changes or updating the description. -
Line 49 —
github.event.comment.user.loginandgithub.event.comment.html_urlare interpolated directly into therun:script via${{ }}rather than being passed through env vars likeCOMMENT_BODYis. These are lower risk (login is alphanumeric, html_url is a GitHub URL), but for consistency with the injection-prevention approach used for the comment body, they could also be passed via env vars.
The agent instruction changes in bonk.md are well-structured — the "triggering comment is the task" rule and the reordered implementation workflow should fix the observed failure mode where Bonk ignored the /bonk comment and fell back to a generic review.
|
I've reviewed and approved PR #13147. Here's a summary: Approval rationale: The core change is sound — the workflow now correctly passes the triggering comment body into the agent's prompt, and the agent instructions are restructured to prioritize acting on that comment rather than falling back to a generic review. Two non-blocking observations I flagged:
|
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
Bonk was ignoring the
/bonkcomment that triggered it and defaulting to a generic PR review instead of acting on the specific request (e.g. "fix the formatting and commit").Root cause: the on-demand workflow (
bonk.yml) never injected the triggering comment body into the agent's context — unlikebonk-pr-review.ymlwhich constructs and passes aprompt.Changes:
bonk.yml— new "Build prompt with triggering comment" step that injectsgithub.event.comment.body(via env var to avoid injection) into theprompt:parameter passed to the ask-bonk action.bonk.md(on-demand agent) — restructured to prioritize the triggering comment:bonk_reviewer.md(auto-review) — raised the LGTM threshold with an explicit "not actionable" list (style, lint-level issues, speculative perf, lockfile changes, etc.)