feat(providers): make proto the primary driver for agent runs#3626
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR routes legacy Claude model identifiers ( ChangesClaude Model ID Routing to ProtoProvider
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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 docstrings
🧪 Generate unit tests (beta)
Comment |
Code Review — ? finding(s)
protoLabs Code Review Report
No findings recorded. |
Code Review — ? finding(s)
protoLabs Code Review Report
No findings recorded. |
Why
PR 2 of the namesake SDK cutover. PR 1 (#3625) added `ProtoProvider` alongside `ClaudeProvider`. This PR flips the defaults so every active model dispatch — Claude-shaped ids included — routes through `@protolabsai/sdk` instead of `@anthropic-ai/claude-agent-sdk`. The Anthropic SDK dependency stays installed for one more PR while `sdk-options.ts` (1000+ lines of Claude-shaped option builders + hook matchers) is migrated; once that lands the dep is removed and `claude-provider.ts` is deleted.
Changes
`apps/server/src/providers/proto-provider.ts` — widened `isProtoModel` to also claim `claude-*` ids and the bare aliases `opus` / `sonnet` / `haiku`. The gateway already resolves Claude SKUs transparently, so callers that store `claude-opus-4-5-...` keep working with no migration on persisted state.
`libs/types/src/model.ts` — `DEFAULT_MODELS.claude` flipped from `claude-opus-4-6` to `protolabs/smart`. Field name preserved through this PR (rename to `proto` lands in PR 3) so the ~6 call sites in `auto-mode-service.ts` and `lead-engineer-processors.ts` compile without touching their lines.
`apps/server/src/services/ava-gateway-service.ts` — instantiates `ProtoProvider` instead of `ClaudeProvider`. The two are interface-compatible (both extend `BaseProvider` and implement `executeQuery`), so this is a one-line file-import change plus a class rename.
`apps/server/tests/unit/providers/provider-factory.test.ts` — bumps Claude-routed expectations to ProtoProvider for the cases the new matcher claims. Tests for "unknown model fallback" and "empty string fallback" still resolve to ClaudeProvider since ProtoProvider's matcher is explicit (no catch-all).
`apps/server/tests/unit/lib/model-resolver.test.ts` — asserts the new `DEFAULT_MODELS.claude` value.
Routing matrix (verified programmatically)
```
protolabs/smart → proto ← new primary
protolabs/fast → proto ← new primary
claude-opus-4-5-20251101 → proto ← legacy id, gateway-routed
claude-sonnet-4-20250514 → proto ← legacy id, gateway-routed
opus → proto ← bare alias, gateway-routed
sonnet → proto ← bare alias, gateway-routed
haiku → proto ← bare alias, gateway-routed
cursor-auto → cursor ← unchanged
codex-gpt-5.5 → codex ← unchanged
unknown-xyz → claude ← unchanged fallback (PR 3 cleans up)
```
What this PR explicitly does NOT change
Validation
After this lands
PR 3 closes the loop:
Summary by CodeRabbit
Release Notes