fix(config): respect PR_AF_MODEL across all tiers; default to kimi-k2.5#18
Merged
Conversation
The `_default_tier_map("opencode")` function previously hardcoded the
budget tier to gemini-2.5-flash, ignoring PR_AF_MODEL even though the
mid and premium tiers honored it. This caused the intake_gate,
coverage_gate, and dedup_gate to silently run on gemini when callers
expected their PR_AF_MODEL setting to apply everywhere. Budget now
falls back to ai_model like the other tiers; PR_AF_MODEL_BUDGET
remains available for callers who want to keep gates on a cheaper
model.
Also updates the stale fallback defaults (minimax-m2.5 / gemini-2.5-flash)
to openrouter/moonshotai/kimi-k2.5, matching the docker-compose env
override and what deployments actually use. .env.example documents
the new defaults and notes that PR_AF_MODEL covers all tiers unless
individually overridden.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a silent override where setting
PR_AF_MODELdid not propagate to thebudgettier (intake_gate / coverage_gate / dedup_gate), and cleans up stale defaults that pointed at minimax / gemini.The leak (real silent override of user intent)
In
_default_tier_map("opencode"),midandpremiumtiers correctly fell back toai_model(which honorsPR_AF_MODEL→AI_MODEL→PR_AF_AI_MODEL), butbudgetwas hardcoded toopenrouter/google/gemini-2.5-flash. SettingPR_AF_MODEL=openrouter/moonshotai/kimi-k2.5left the budget-tier gates running on gemini with no warning. Nowbudgetfalls back toai_modellike the other tiers, so a singlePR_AF_MODELenv var actually applies everywhere.PR_AF_MODEL_BUDGETstill works for callers who want to keep gates cheap.Default cleanup
AIIntegrationConfig.harness_model:minimax/minimax-m2.5→openrouter/moonshotai/kimi-k2.5AIIntegrationConfig.ai_model:minimax/minimax-m2.5→openrouter/moonshotai/kimi-k2.5_default_tier_mapai_model fallback:openrouter/google/gemini-2.5-flash→openrouter/moonshotai/kimi-k2.5.env.example: updated documented examples + added a note thatPR_AF_MODELcovers all tiers unless overridden per-tier.Out of scope
claude-codeprovider tier map (haiku/sonnet/opus) is left as-is — those identifiers are required by the Claude Agent SDK, not a configurable preference.router.app.harness(..., model=model or None)androuter.app.ai(..., model=...)call sites already thread the user's model through correctly; no changes needed there.Test plan
AIIntegrationConfig().harness_model == "openrouter/moonshotai/kimi-k2.5"PR_AF_MODEL=openrouter/moonshotai/kimi-k2.5, confirm_default_tier_map()returns kimi for budget/mid/premiumPR_AF_MODEL_BUDGET=openrouter/google/gemini-2.5-flashandPR_AF_MODEL=openrouter/moonshotai/kimi-k2.5, confirm budget=gemini and mid/premium=kimi (per-tier override still wins)🤖 Generated with Claude Code