Skip to content

ci: unbreak Bonk (switch to Workers AI) - #149

Open
andre-j3sus wants to merge 6 commits into
mainfrom
ajesus/fix-bonk-opencode-version
Open

ci: unbreak Bonk (switch to Workers AI)#149
andre-j3sus wants to merge 6 commits into
mainfrom
ajesus/fix-bonk-opencode-version

Conversation

@andre-j3sus

Copy link
Copy Markdown
Collaborator

Bonk has failed on every run since 2026-08-18. Three faults stacked, each
hiding the next.

The pinned OpenCode 1.15.13 reported nothing on failure — empty comment, no
error in the logs — which is why this went unnoticed for three weeks. Bumping
it surfaced the second fault: claude-opus-4-8 is not a valid id, the version
component is dot-separated. Fixing that reached the provider and exposed the
real one:

AI_APICallError: Invalid Anthropic API Key

The CF_AI_GATEWAY_* secrets are fine; the gateway's upstream Anthropic key is
not, so every anthropic/* model fails regardless of id. That also explains why
cloudflare-docs' bigbonk.yml (anthropic) has never executed while its
bonk.yml (Workers AI) is green.

So this moves to Workers AI on the same kimi-k2.6 / 1.17.7 pair cloudflare-docs
runs green. The code-optimized kimi-k2.7-code was tried and reverted: it wins
on coding benchmarks but answers LGTM! without the summary the prompt asks
for, on a 2-line diff and a 20-line one alike. Its advertised 30% reduction in
reasoning tokens seems to cost exactly the analysis a review wants.

AGENTS.md picks up 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.

One cosmetic leftover: the title sub-agent still defaults to Anthropic and
logs an error, which does not affect the review.

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.
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.
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.
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.
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.
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.
@andre-j3sus andre-j3sus self-assigned this Aug 24, 2026
@ask-bonk

ask-bonk Bot commented Aug 24, 2026

Copy link
Copy Markdown

This PR resolves three stacked failures in the Bonk workflow:

  1. Bumps ask-bonk/opencode from 1.15.13 to 1.17.7 — The older version silently swallowed model failures, producing empty comments and no log output, which hid the outage.
  2. Switches the model from Anthropic to Workers AI (kimi-k2.6) — The AI Gateway's upstream Anthropic key is invalid, so all anthropic/* model calls return authentication_error regardless of model ID. This is the root cause discovered after fixing the version pin.
  3. Updates the model ID itself — The previous claude-opus-4-8 was malformed (dash-separated version instead of dot-separated, e.g. claude-3-opus-20240229-style), which would have failed even if the provider key were valid.

The PR also adds an "AI review (Bonk)" section to AGENTS.md documenting the Anthropic gateway limitation and the issue_comment-on-main execution behavior, which will be useful for future maintainers.

I reviewed both the workflow YAML and the markdown diff. The YAML syntax is valid, secrets usage is unchanged, job permissions are still correctly restrictive (NO_PUSH, contents: read), and the new comments accurately explain the choices. No correctness, security, or style issues found.

LGTM!

github run

@andre-j3sus
andre-j3sus marked this pull request as ready for review August 24, 2026 22:01
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.

2 participants