From 36d698ba102ffa620224134aabdec2c4cb092289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jesus?= Date: Mon, 24 Aug 2026 17:32:36 +0100 Subject: [PATCH 1/6] ci: unbreak Bonk by bumping the pinned OpenCode version Bonk has failed on every run since 2026-08-18; the last success was 2026-07-31. Each run creates a session, sends the message, logs a single "loop { step: 0 }", then emits zero tokens and exits 1 -- the provider never initializes. bonk.yml has not changed since it was added, and cloudflare/workers-sdk fails identically while pinning a March action SHA, so neither this repo's config nor the action code is the cause. What both broken repos share is the 1.15.13 pin. ask-bonk#226 tracked the same provider-initialization failures on 2026-08-18 and verified a working run on 1.18.18. Keeping the version pinned rather than moving to latest, since floating is what produced this drift in the first place. --- .github/workflows/bonk.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index 77f5859f..45f54628 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -53,7 +53,10 @@ jobs: permissions: write # Review-only: Bonk leaves comments/suggestions but never pushes commits. token_permissions: NO_PUSH - opencode_version: 1.15.13 # pin to this version as certain ones cause ProviderInitError issues + # 1.15.13 stopped initializing the provider around 2026-08-18 (see + # ask-bonk#226); every run since produced zero tokens and an empty + # comment. 1.18.18 is the version that diagnostic verified working. + opencode_version: 1.18.18 prompt: | Review this pull request. Summarize what it changes and flag any correctness, security, or style issues as inline review comments. From 8441b738c8c444465f9b6d694b841b6def4abd15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jesus?= Date: Mon, 24 Aug 2026 17:34:46 +0100 Subject: [PATCH 2/6] ci: fix the Bonk model id Bumping OpenCode surfaced the error 1.15.13 was swallowing: Model not found: cloudflare-ai-gateway/anthropic/claude-opus-4-8. Did you mean: anthropic/claude-opus-4.5, anthropic/claude-opus-4.6, anthropic/claude-opus-4.7? The version component is dot-separated, and 4.8 does not exist. Moving to 4.7, the newest the gateway offers. --- .github/workflows/bonk.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index 45f54628..317641a1 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -47,7 +47,8 @@ jobs: CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }} CLOUDFLARE_API_TOKEN: ${{ secrets.CF_AI_GATEWAY_TOKEN }} with: - model: "cloudflare-ai-gateway/anthropic/claude-opus-4-8" + # Dots, not hyphens: `claude-opus-4-8` does not resolve. + model: "cloudflare-ai-gateway/anthropic/claude-opus-4.7" mentions: "/bonk,@ask-bonk" # Only users with write access may invoke Bonk via comment. permissions: write From 49e8532ebcff66f7e33e12bc4cc18d58982aa34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jesus?= Date: Mon, 24 Aug 2026 17:48:47 +0100 Subject: [PATCH 3/6] ci: switch Bonk to Workers AI Fixing the model id got past "Model not found" and reached the provider, which then returned: AI_APICallError: Invalid Anthropic API Key {"code":"authentication_error","message":"Invalid Anthropic API Key"} The three CF_AI_GATEWAY_* secrets are fine -- they authenticate to the gateway. What is invalid is the gateway's upstream Anthropic key, so every anthropic/* model fails the same way regardless of id. That also explains why cloudflare-docs' bigbonk.yml (anthropic) has never once executed while its bonk.yml (Workers AI) is green. Adopting that working pair verbatim: kimi-k2.6 over Workers AI, which needs no Anthropic credential, on the 1.17.7 they run it against. --- .github/workflows/bonk.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index 317641a1..76f2dfdb 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -47,17 +47,19 @@ jobs: CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }} CLOUDFLARE_API_TOKEN: ${{ secrets.CF_AI_GATEWAY_TOKEN }} with: - # Dots, not hyphens: `claude-opus-4-8` does not resolve. - model: "cloudflare-ai-gateway/anthropic/claude-opus-4.7" + # Workers AI, not Anthropic: the gateway's upstream Anthropic key is + # invalid, so anthropic/* returns authentication_error regardless of + # the model id. Mirrors the working cloudflare-docs configuration. + model: "cloudflare-ai-gateway/workers-ai/@cf/moonshotai/kimi-k2.6" mentions: "/bonk,@ask-bonk" # Only users with write access may invoke Bonk via comment. permissions: write # Review-only: Bonk leaves comments/suggestions but never pushes commits. token_permissions: NO_PUSH - # 1.15.13 stopped initializing the provider around 2026-08-18 (see - # ask-bonk#226); every run since produced zero tokens and an empty - # comment. 1.18.18 is the version that diagnostic verified working. - opencode_version: 1.18.18 + # 1.15.13 reported nothing at all when the model call failed, which + # hid this breakage for three weeks. 1.17.7 is the version running + # green in cloudflare-docs against the same model. + opencode_version: "1.17.7" prompt: | Review this pull request. Summarize what it changes and flag any correctness, security, or style issues as inline review comments. From 7ead5afc17156d41f80019039c890bcbf8628bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jesus?= Date: Mon, 24 Aug 2026 17:57:54 +0100 Subject: [PATCH 4/6] ci: use the code-optimized Kimi variant for Bonk kimi-k2.6 came from copying the cloudflare-docs config. kimi-k2.7-code is the code-optimized variant of the same family, at identical input and output pricing: +21.8% on Kimi Code Bench v2, +11.0% on Program Bench, and 30% fewer reasoning tokens. Cached input is $0.19/M against $0.16/M, which the token reduction should more than cover. Upstream states API usage is unchanged, and k2.6 is not deprecated, so reverting is a one-token change if this regresses. --- .github/workflows/bonk.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index 76f2dfdb..a90b19bf 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -49,8 +49,8 @@ jobs: with: # Workers AI, not Anthropic: the gateway's upstream Anthropic key is # invalid, so anthropic/* returns authentication_error regardless of - # the model id. Mirrors the working cloudflare-docs configuration. - model: "cloudflare-ai-gateway/workers-ai/@cf/moonshotai/kimi-k2.6" + # the model id. Code-optimized variant, same price as kimi-k2.6. + model: "cloudflare-ai-gateway/workers-ai/@cf/moonshotai/kimi-k2.7-code" mentions: "/bonk,@ask-bonk" # Only users with write access may invoke Bonk via comment. permissions: write @@ -58,7 +58,7 @@ jobs: token_permissions: NO_PUSH # 1.15.13 reported nothing at all when the model call failed, which # hid this breakage for three weeks. 1.17.7 is the version running - # green in cloudflare-docs against the same model. + # green in cloudflare-docs. opencode_version: "1.17.7" prompt: | Review this pull request. Summarize what it changes and flag any From 467ff6af470809af644b6bf116bdb9c1748b542f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jesus?= Date: Mon, 24 Aug 2026 22:42:08 +0100 Subject: [PATCH 5/6] docs: document the Bonk review setup Records the two things that are not evident from the workflow file: the Anthropic provider is unusable through this gateway, and comment-triggered runs execute main's copy of the workflow, so changes to it cannot be verified with /bonk on a PR. --- AGENTS.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index f4e1990b..5e81c963 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,3 +96,19 @@ re-indent every workflow. 4. On merge, the publish workflow auto-creates a git tag and publishes to npm. - **Do NOT** push directly to `main` — the branch ruleset blocks direct pushes. All changes must go through a pull request. + +## AI review (Bonk) + +`.github/workflows/bonk.yml` reviews PRs automatically on open, and on demand +when someone with write access comments `/bonk`. + +Two things to know before editing that workflow: + +- It runs on **Workers AI**, not Anthropic. The AI Gateway's upstream Anthropic + key is invalid, so any `anthropic/*` model returns `authentication_error` + regardless of the model id. +- **Comment-triggered runs execute the workflow from `main`,** because + `issue_comment` is a repository-level event. Changes to this file cannot be + tested with `/bonk` on a PR — only the `pull_request: [opened]` trigger uses + the branch copy, and it does not fire on pushes to an open PR. Verifying a + change means opening a fresh PR. From 37a398c675c535abbece514856f5592df5e03c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jesus?= Date: Mon, 24 Aug 2026 22:58:48 +0100 Subject: [PATCH 6/6] ci: revert Bonk to kimi-k2.6 k2.7-code wins on coding benchmarks but does not follow the review prompt. Measured on this PR: k2.6 2-line diff 10 loops full structured review k2.7-code 2-line diff 5 loops "LGTM!" k2.7-code 20-line diff 7 loops "LGTM!" The prompt asks it to summarize the change and flag issues; k2.7-code skips the summary regardless of diff size. Its advertised 30% reduction in reasoning tokens appears to cost exactly the analysis we want. Benchmarks measured coding ability, not instruction-following, and the latter is what a review bot needs. --- .github/workflows/bonk.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index a90b19bf..acccbc8a 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -49,8 +49,9 @@ jobs: with: # Workers AI, not Anthropic: the gateway's upstream Anthropic key is # invalid, so anthropic/* returns authentication_error regardless of - # the model id. Code-optimized variant, same price as kimi-k2.6. - model: "cloudflare-ai-gateway/workers-ai/@cf/moonshotai/kimi-k2.7-code" + # the model id. k2.6 over the newer k2.7-code: the latter answers + # "LGTM!" without the summary the prompt asks for, on diffs of any size. + model: "cloudflare-ai-gateway/workers-ai/@cf/moonshotai/kimi-k2.6" mentions: "/bonk,@ask-bonk" # Only users with write access may invoke Bonk via comment. permissions: write