From 13a7c84c068c2b584803c583b2b33ff2cc24c6aa Mon Sep 17 00:00:00 2001 From: mvm Date: Fri, 21 Aug 2026 10:42:45 -0500 Subject: [PATCH] fix: use deepseek-v4-flash for conventions review to avoid AI rate limits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The conventions reviewer agent was using the same frontier model (kimi-k2.7-code) as code review, style guide, and reconcile. When multiple PRs trigger concurrent reviews, all agents share the same Workers AI rate limit pool and the conventions agent — being a single agent with no per-file degradation — fails the entire stream on a single 429. Switch conventions to cloudflare/@cf/deepseek-ai/deepseek-v4-flash-0731, a lighter Cloudflare-hosted model with function calling support that is sufficient for the three simple PR-metadata rules (title naming, description quality, scope accuracy). This moves conventions off the frontier model rate limit pool and reduces cost (~2x cheaper on input tokens: $0.44/M vs $0.95/M). --- .flue/AGENTS.md | 2 +- .flue/agents/conventions-reviewer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flue/AGENTS.md b/.flue/AGENTS.md index 3237a35ebbc..5134e911f66 100644 --- a/.flue/AGENTS.md +++ b/.flue/AGENTS.md @@ -77,7 +77,7 @@ Code review and style-guide review fan out **one agent instance per changed file - **R2** (`DOCS_FLUE_BUCKET`) holds cross-run review state under `diffs/pr-/`: `review-.json` (`{ code: […], style: […], conventions: […] }`; a legacy bare array means style-only), `auto-review-count.json`, `ignore-review-limit.json`, `auto-review-disabled.json`. There is **no rendezvous namespace** in 2.0 — Workflow step durability replaced the R2 finalize lock, and the diff is staged in agent memory / delivered via tools rather than R2. - The bot keeps **one** comment per PR, located via the `BOT_COMMENT_MARKER` HTML comment. It embeds `reviewed-head-sha`, `reviewed-at`, and `status` markers used to detect prior state and to partition the human comments posted after it (`lib/code-review-state.ts`). - `lib/code-review-render.ts` renders the single comment under a `## Review` heading: a status line, a collapsed "Fix in your agent" prompt block (only when there is an active finding), then `### Code Review`, `### Conventions`, `### Style Guide Review`, an "Acknowledged by author" block, and a Commands block. Findings are tables only; there are no inline review comments. It also renders the `/rebase` status line (`renderRebaseStatusUpdate`). -- **Models**: specialist and reconciliation model calls use `cloudflare/@cf/moonshotai/kimi-k2.7-code`. The validation step uses `cloudflare/@cf/zai-org/glm-5.2`. +- **Models**: specialist and reconciliation model calls use `cloudflare/@cf/moonshotai/kimi-k2.7-code`, except the conventions reviewer which uses `cloudflare/@cf/deepseek-ai/deepseek-v4-flash-0731` (a lighter model sufficient for PR-metadata checks). The validation step uses `cloudflare/@cf/zai-org/glm-5.2`. - **Review mode** (`DOCS_FLUE_REVIEW_MODE`): `log` (default) renders and logs the comment without mutating GitHub; `comment` posts/updates the bot comment. ### Slash commands (codeowner-only, commented on a PR) diff --git a/.flue/agents/conventions-reviewer.ts b/.flue/agents/conventions-reviewer.ts index 22231ebcb66..4066624a211 100644 --- a/.flue/agents/conventions-reviewer.ts +++ b/.flue/agents/conventions-reviewer.ts @@ -32,7 +32,7 @@ import * as v from "valibot"; import conventionsCheckSkill from "../.agents/skills/conventions-check/SKILL.md"; import { useBotRole } from "../lib/bot-role"; -const MODEL = "cloudflare/@cf/moonshotai/kimi-k2.7-code"; +const MODEL = "cloudflare/@cf/deepseek-ai/deepseek-v4-flash-0731"; /** Name of the data part the structured result is written to. */ export const CONVENTIONS_REVIEW_DATA = "conventions_review";