[PR #163] [MERGED] fix: add scope constraint to Bonk agent prompts #361

Closed
opened 2026-05-06 12:39:25 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/163
Author: @elithrar
Created: 2/27/2026
Status: Merged
Merged: 2/27/2026
Merged by: @elithrar

Base: mainHead: fix/161-bonk-scope-constraint


📝 Commits (4)

  • d5516b4 fix: add scope constraint to Bonk agent prompts (#161)
  • 43bcd64 Apply suggestion from @elithrar
  • b2bf641 Apply suggestion from @elithrar
  • a914b48 fix: reference $ISSUE_NUMBER/$PR_NUMBER env vars as ground truth in scope constraint

📊 Changes

4 files changed (+16 additions, -4 deletions)

View changed files

📝 .github/workflows/bigbonk.yml (+1 -1)
📝 .github/workflows/bonk.yml (+1 -1)
📝 .opencode/agents/reviewer.md (+2 -0)
📝 .opencode/agents/viguy.md (+12 -2)

📄 Description

Bonk can occasionally comment on or interact with the wrong issue/PR when invoked via /bonk. Fixes #161.

The viguy prompt had no explicit constraint scoping the agent to the triggering issue/PR — and step 3 ("Search for related issues and PRs") actively encouraged exploring other issues without guardrails against interacting with them. This mirrors the same problem fixed in cloudflare/workerd#6150 for auto-triggered PR reviews.

  • add "Scope constraint" section to viguy.md as the highest-priority rule, placed early in the prompt for primacy. constrains all gh write commands to the invoking issue/PR, with explicit instructions to only link (not interact with) related issues found during research.
  • update step 3 of "Before starting work" to mark related-issue search as read-only with bold warning
  • add one-line scope constraint to reviewer.md for the reviewer subagent
  • increase fetch-depth from 1 to 30 in both bonk.yml and bigbonk.yml — gives the agent meaningful git history for diffs, reducing the need to search elsewhere for context (same change as workerd#6150)

Verification is manual — trigger /bonk on a PR and confirm it only references the correct PR number.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/163 **Author:** [@elithrar](https://github.com/elithrar) **Created:** 2/27/2026 **Status:** ✅ Merged **Merged:** 2/27/2026 **Merged by:** [@elithrar](https://github.com/elithrar) **Base:** `main` ← **Head:** `fix/161-bonk-scope-constraint` --- ### 📝 Commits (4) - [`d5516b4`](https://github.com/cloudflare/vinext/commit/d5516b464a5aa041132d31f969fbabf1b4852bb8) fix: add scope constraint to Bonk agent prompts (#161) - [`43bcd64`](https://github.com/cloudflare/vinext/commit/43bcd644e203e39b47c33f424536084e7f3b7578) Apply suggestion from @elithrar - [`b2bf641`](https://github.com/cloudflare/vinext/commit/b2bf6419b8787a4cc87c4d2fd87ad65eefe075f1) Apply suggestion from @elithrar - [`a914b48`](https://github.com/cloudflare/vinext/commit/a914b48441f5c5245be432d11c897980c80bbcca) fix: reference $ISSUE_NUMBER/$PR_NUMBER env vars as ground truth in scope constraint ### 📊 Changes **4 files changed** (+16 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/bigbonk.yml` (+1 -1) 📝 `.github/workflows/bonk.yml` (+1 -1) 📝 `.opencode/agents/reviewer.md` (+2 -0) 📝 `.opencode/agents/viguy.md` (+12 -2) </details> ### 📄 Description Bonk can occasionally comment on or interact with the wrong issue/PR when invoked via `/bonk`. Fixes #161. The viguy prompt had no explicit constraint scoping the agent to the triggering issue/PR — and step 3 ("Search for related issues and PRs") actively encouraged exploring other issues without guardrails against interacting with them. This mirrors the same problem fixed in cloudflare/workerd#6150 for auto-triggered PR reviews. - add "Scope constraint" section to `viguy.md` as the highest-priority rule, placed early in the prompt for primacy. constrains all `gh` write commands to the invoking issue/PR, with explicit instructions to only link (not interact with) related issues found during research. - update step 3 of "Before starting work" to mark related-issue search as read-only with bold warning - add one-line scope constraint to `reviewer.md` for the reviewer subagent - increase `fetch-depth` from 1 to 30 in both `bonk.yml` and `bigbonk.yml` — gives the agent meaningful git history for diffs, reducing the need to search elsewhere for context (same change as workerd#6150) Verification is manual — trigger `/bonk` on a PR and confirm it only references the correct PR number. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:25 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#361
No description provided.