fix(models): three-tier gateway defaults — fast / smart / reasoning#3652
Conversation
Closes feature-1779521707518-ykrqtenoj on the protomaker board.
The boxed defaults pointed at raw Anthropic IDs (claude-haiku-4-5,
claude-sonnet-4-6, claude-opus-4-6). On a fresh install the only
credential present is the protoLabs gateway key, which only authorizes
protolabs/* models — so the defaults 401'd every time a feature
dispatched without an explicit model field. We hit this earlier today
on a crew smoke test.
Three code-work tiers map cleanly:
protolabs/fast — trivial / quick tasks (haiku-equivalent)
protolabs/smart — feature work (sonnet-equivalent)
protolabs/reasoning — architectural / spec (opus-equivalent)
Files touched:
- libs/types/src/agent-settings.ts — DEFAULT_PHASE_MODELS
- libs/types/src/model.ts — DEFAULT_MODELS.{claude,autoMode,trivial}
- apps/server/src/services/auto-mode-service.ts — log lines
- apps/server/src/services/lead-engineer-processors.ts — log lines
- CLAUDE.md — model hierarchy table
- docs/integrations/ai-providers.md — complexity tiers + per-phase tables
Note: protolabs/reasoning must be configured on the gateway before
this lands.
Verified:
- npm run typecheck — 21/21 packages clean
- npm run test:server -- tests/unit/services/auto-mode
tests/unit/services/lead-engineer — 282/282 pass
- resolveModelString('protolabs/reasoning') → 'protolabs/reasoning'
- resolveModelString(undefined) → 'protolabs/reasoning'
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Code Review — ? finding(s)
protoLabs Code Review Report
No findings recorded. |
|
Warning Review limit reached
Your plan currently allows 8 reviews/hour. Refill in 34 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR updates default AI model selection across the system from direct Claude model IDs (haiku, sonnet, opus) to protoLabs gateway-backed tier IDs (fast, smart, reasoning). Configuration constants, service logging, and documentation are synchronized to reflect the new tier routing. ChangesModel Tier Gateway Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/types/src/agent-settings.ts`:
- Around line 243-245: The comment indicates a mismatch: in the "Quick tasks —
fast tier" block you have enhancementModel set to 'protolabs/smart' while
fileDescriptionModel is 'protolabs/fast'; fix by either moving the
enhancementModel entry out of the fast-tier section (so it stays as
'protolabs/smart' under the correct tier) or change enhancementModel to
'protolabs/fast' to match the fast-tier comment; locate and update the
enhancementModel and fileDescriptionModel entries in the agent settings
(symbols: enhancementModel, fileDescriptionModel) so the comment and values are
consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 257a63f2-214b-4223-ab14-2030695da89d
📒 Files selected for processing (6)
CLAUDE.mdapps/server/src/services/auto-mode-service.tsapps/server/src/services/lead-engineer-processors.tsdocs/integrations/ai-providers.mdlibs/types/src/agent-settings.tslibs/types/src/model.ts
| // Quick tasks — fast tier | ||
| enhancementModel: { model: 'protolabs/smart' }, | ||
| fileDescriptionModel: { model: 'protolabs/fast' }, |
There was a problem hiding this comment.
Comment-to-default mismatch on enhancement tier.
The heading says “Quick tasks — fast tier”, but enhancementModel is set to protolabs/smart. Please either move this entry out of the fast-tier section or adjust the value/comment to match.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@libs/types/src/agent-settings.ts` around lines 243 - 245, The comment
indicates a mismatch: in the "Quick tasks — fast tier" block you have
enhancementModel set to 'protolabs/smart' while fileDescriptionModel is
'protolabs/fast'; fix by either moving the enhancementModel entry out of the
fast-tier section (so it stays as 'protolabs/smart' under the correct tier) or
change enhancementModel to 'protolabs/fast' to match the fast-tier comment;
locate and update the enhancementModel and fileDescriptionModel entries in the
agent settings (symbols: enhancementModel, fileDescriptionModel) so the comment
and values are consistent.
Three test assertions had the old default values baked in:
- apps/server/tests/unit/lib/model-resolver.test.ts:161
DEFAULT_MODELS.claude was 'protolabs/smart' before the 3-tier
work, is now 'protolabs/reasoning'.
- apps/server/tests/unit/services/settings-service.test.ts:745
Migration-defaults check for specGenerationModel — was
'claude-opus', is now 'protolabs/reasoning'.
- apps/server/tests/unit/services/settings-service.test.ts:760-762
'use default phase models when none configured' — updated all
three to gateway-routed defaults.
No production code change. Targeted server tests pass: 282/282 on
auto-mode + lead-engineer, 61/61 on libs/model-resolver, and the full
server suite recovers to clean.
Code Review — ? finding(s)
protoLabs Code Review Report
No findings recorded. |
Closes `feature-1779521707518-ykrqtenoj` on the protomaker board.
Problem
The boxed defaults (`DEFAULT_PHASE_MODELS` in `libs/types/src/agent-settings.ts` and `DEFAULT_MODELS` in `libs/types/src/model.ts`) pointed at raw Anthropic IDs (`claude-haiku-4-5-20251001`, `claude-sonnet-4-6`, `claude-opus-4-6`). On a fresh install the only credential present is the protoLabs gateway key, which only authorizes `protolabs/*` models — so the defaults 401'd every time a feature dispatched without an explicit `model` field. We hit this earlier today on a crew smoke test.
Fix
Three code-work tiers map cleanly:
Note
`protolabs/reasoning` must be configured on the gateway before this lands.
What's NOT changed (separate follow-up)
These call sites still hardcode raw `claude-*` IDs and aren't on the crew-dispatch path:
Verification
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores