refactor(cli): canonicalize provider identifiers - #1110
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR centralizes provider identifier usage across shared provider settings, model registries, CLI commands, and utilities. It adds exported CLI resolution helpers and expands tests for provider configuration, context windows, model listing, and option precedence. ChangesProvider identifier centralization
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/cli/src/lib/utils/__tests__/context-window.test.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. apps/cli/src/lib/utils/context-window.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 `@apps/cli/src/lib/utils/context-window.ts`:
- Around line 39-53: Update getContextWindow’s provider switch to handle
opencode-go, kenari, and zoo-gateway using config.opencodeGoModelId,
config.kenariModelId, and config.zooGatewayModelId respectively, matching
modelIdKeysByProvider so provider-specific configurations resolve correctly. Add
corresponding coverage in the context-window tests for each provider.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e2162954-a3b9-4a83-8d11-ab66aeaf8af8
📒 Files selected for processing (12)
apps/cli/src/commands/cli/__tests__/list.test.tsapps/cli/src/commands/cli/__tests__/run.test.tsapps/cli/src/commands/cli/list.tsapps/cli/src/commands/cli/run.tsapps/cli/src/lib/utils/__tests__/context-window.test.tsapps/cli/src/lib/utils/__tests__/provider.test.tsapps/cli/src/lib/utils/context-window.tsapps/cli/src/lib/utils/provider.tsapps/cli/src/types/__tests__/types.test.tsapps/cli/src/types/types.tspackages/types/src/__tests__/provider-identifiers.test.tspackages/types/src/provider-settings.ts
Summary
providerIdentifiersgetProviderSettings()dispatch casesrun.tsandlist.tsImplements item 2 from #944 (comment).
Dependency
Stacked on #1109, which introduces the shared canonical provider-settings migration used as this branch's base. Until #1109 is merged, GitHub may show that parent commit in this PR's diff.
Test plan
pnpm testfromapps/cli(549 passed, 1 skipped)pnpm check-typesfromapps/clipnpm lintfromapps/cligit diff --checkSummary by CodeRabbit
New Features
Bug Fixes