Skip to content

fix: register DeepSeek V4 Flash for Bonk - #33255

Open
irvinebroque wants to merge 2 commits into
productionfrom
fix/register-deepseek-bonk
Open

fix: register DeepSeek V4 Flash for Bonk#33255
irvinebroque wants to merge 2 commits into
productionfrom
fix/register-deepseek-bonk

Conversation

@irvinebroque

@irvinebroque irvinebroque commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Registers DeepSeek V4 Flash in the OpenCode configuration so Bonk can resolve the model already selected by its workflow.

PR #33193, merged in commit 660c3cfa95, switched Bonk from Kimi K2.6 to DeepSeek V4 Flash. Although DeepSeek V4 Flash is available through Workers AI and AI Gateway, it was not registered in OpenCode 1.17.7's Cloudflare AI Gateway model catalog or the repository's opencode.jsonc.

As a result, OpenCode could not resolve the configured model when Bonk sent its first prompt. The run failed before inference and surfaced the model lookup failure as share subscriber failed followed by exit code 1.

This change explicitly defines the model's capabilities and limits in opencode.jsonc, allowing Bonk to continue using DeepSeek V4 Flash.

@github-actions github-actions Bot added the size/s label Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
* @cloudflare/product-owners

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 5, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-register-deepseek-bonk.previews.developers.cloudflare.com (commit 9fa7d75)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://d099b759.previews.developers.cloudflare.com 9fa7d75 2026-09-05T16:53:58.102Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://3b25755e.previews.developers.cloudflare.com ed81de0 2026-09-05T16:07:32.587Z Visit the dashboard ↗

@irvinebroque

Copy link
Copy Markdown
Contributor Author

/bonk review

@cloudflare cloudflare deleted a comment from ask-bonk Bot Sep 5, 2026
@cloudflare cloudflare deleted a comment from ask-bonk Bot Sep 5, 2026
@irvinebroque
irvinebroque marked this pull request as ready for review September 5, 2026 16:12
@irvinebroque
irvinebroque requested a review from a team as a code owner September 5, 2026 16:12
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review

💡 1 suggestion found in commit 9fa7d75.

👉 Fix in your agent 👈
Fix the following review findings in PR #33255 (https://github.com/cloudflare/cloudflare-docs/pull/33255).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.

---

## Code Review

### Suggestions (1)

#### CR-5aff35ec8288 · Output limit equals full context window
- **File:** `opencode.jsonc` line 43
- **Issue:** The added GLM-4.7-Flash entry sets `limit.output: 131072`, the same as `limit.context`. The other models in this file cap output well below context (DeepSeek: 64000 with 1048576 context; Kimi: 64000 with 256000 context), and an output limit equal to the whole context is never reachable once any input tokens are present. This looks like the context value was copied into `output` by mistake.
- **Fix:** Verify GLM-4.7-Flash's actual max output on Workers AI and set `limit.output` to a realistic value (e.g. 64000, matching the other entries); an overestimated output cap can cause OpenCode to request `max_tokens` values the API rejects or to misestimate available output tokens.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Suggestions (1)
File Issue
opencode.jsonc line 43 Output limit equals full context window — The added GLM-4.7-Flash entry sets limit.output: 131072, the same as limit.context. The other models in this file cap output well below context (DeepSeek: 64000 with 1048576 context; Kimi: 64000 with 256000 context), and an output limit equal to the whole context is never reachable once any input tokens are present. This looks like the context value was copied into output by mistake. Fix: Verify GLM-4.7-Flash's actual max output on Workers AI and set limit.output to a realistic value (e.g. 64000, matching the other entries); an overestimated output cap can cause OpenCode to request max_tokens values the API rejects or to misestimate available output tokens.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Comment thread opencode.jsonc
"options": {
"parallel_tool_calls": true,
},
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: mvvmm <mvvmm@users.noreply.github.com>
@ask-bonk

ask-bonk Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Yes — I've added it. Registered workers-ai/@cf/zai-org/glm-4.7-flash in opencode.jsonc:29 with its real parameters (131072 context/output, tool calling, reasoning_content interleaving), matching the ID used as the small_model in bonk.yml:78.

To be precise on "need": OpenCode resolves the small_model leniently — if it's not in the model catalog, getSmallModel swallows the lookup error and title generation falls back to the primary model (prompt.ts:204). So the run wouldn't fail without it. But since bonk.yml explicitly selects GLM-4.7 Flash as the cheap small model, registering it ensures that config is actually honored rather than silently falling back to DeepSeek V4 Flash.

github run

@mvvmm

mvvmm commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Yes — I've added it. Registered workers-ai/@cf/zai-org/glm-4.7-flash in opencode.jsonc:29 with its real parameters (131072 context/output, tool calling, reasoning_content interleaving), matching the ID used as the small_model in bonk.yml:78.

To be precise on "need": OpenCode resolves the small_model leniently — if it's not in the model catalog, getSmallModel swallows the lookup error and title generation falls back to the primary model (prompt.ts:204). So the run wouldn't fail without it. But since bonk.yml explicitly selects GLM-4.7 Flash as the cheap small model, registering it ensures that config is actually honored rather than silently falling back to DeepSeek V4 Flash.

github run

wth I didn't know bonk could respond to and act on comments like this?

Oh is it because bonk in the URL lol

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants