Skip to content

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

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

ci: unbreak Bonk (switch to Workers AI)#148
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, which needs no Anthropic credential, on the 1.17.7
that cloudflare-docs runs green. The model is kimi-k2.7-code rather than the
kimi-k2.6 they use: same family, identical input and output pricing, but
code-optimized — +21.8% on Kimi Code Bench v2, +11.0% on Program Bench, and 30%
fewer reasoning tokens.

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

ask-bonk Bot commented Aug 24, 2026

Copy link
Copy Markdown

LGTM!

github run

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

Copy link
Copy Markdown
Collaborator Author

Reopening on kimi-k2.6 after k2.7-code proved too terse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant