-
Notifications
You must be signed in to change notification settings - Fork 4
feat: make models configurable via env variables #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- add `Model` type and env-based logic for COMMIT_MODEL and CHANGELOG_MODEL with defaults - export COMMIT_MODEL and CHANGELOG_MODEL for runtime usage
|
@swoh816 is attempting to deploy a commit to the exon Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Rate limit exceeded@swoh816 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 56 seconds before requesting another review. β How to resolve this issue?After the wait time has elapsed, 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 the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. π Files selected for processing (1)
WalkthroughRefactored model configuration in Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~10 minutes
Poem
Pre-merge checks and finishing touchesβ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
π§Ή Nitpick comments (1)
src/lib/opencode.ts (1)
25-68: Consider extracting a helper to reduce duplication.The parsing logic for
COMMIT_MODELandCHANGELOG_MODELis nearly identical. A helper function would improve maintainability.π Example refactor:
function parseModelEnv( envVar: string, envName: string, defaultModel: Model ): Model { const value = process.env[envVar]; if (!value) { return defaultModel; } const [providerID, modelID] = value.split("/"); if (!providerID || !modelID) { throw new Error( `${envName} must be in the form 'provider/model', e.g. 'opencode/gpt-5-nano', 'ollama/ministral-3:14b', etc.` ); } return { providerID, modelID }; } export const COMMIT_MODEL = parseModelEnv( "COMMIT_MODEL", "COMMIT_MODEL", { providerID: "opencode", modelID: "gpt-5-nano" } ); export const CHANGELOG_MODEL = parseModelEnv( "CHANGELOG_MODEL", "CHANGELOG_MODEL", { providerID: "opencode", modelID: "claude-sonnet-4-5" } );
π Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
src/lib/opencode.ts(2 hunks)
π§° Additional context used
πͺ Biome (2.1.2)
src/lib/opencode.ts
[error] 39-39: This code will never be reached ...
... because this statement will throw an exception beforehand
(lint/correctness/noUnreachable)
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Vercel Agent Review
π Additional comments (1)
src/lib/opencode.ts (1)
21-24: LGTM!The
Modeltype provides a clean abstraction for the provider/model configuration.
- change bitwise OR (|) to logical OR (||) to correct semantics - drop unreachable exit code
Make models configurable through environment variables. As future work, implement a mechanism to verify that each model is accessible and properly defined in opencode.jsonc.
Summary by CodeRabbit
βοΈ Tip: You can customize this high-level summary in your review settings.