-
Notifications
You must be signed in to change notification settings - Fork 496
feat: ideation configurable model #515
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
feat: ideation configurable model #515
Conversation
…l defaults Add a separate ideationModel configuration to give users granular control over which AI model powers the Ideation pane, distinct from suggestionsModel. Changes for ideationModel setting: - Add ideationModel to PhaseModelConfig interface (libs/types) - Add default value (sonnet) in DEFAULT_PHASE_MODELS - Add UI entry 'Ideation & Brainstorming' in Model Defaults settings - Update ideation-service.ts to use ideationModel for interactive chat Fix for task model defaults from ideation: - Pass settingsService to ideation routes - Update add-suggestion.ts to get defaultFeatureModel from settings - Features created from ideation suggestions now use the configured model This ensures: 1. Ideation chat uses the user's configured ideationModel 2. Tasks created from ideation use the user's defaultFeatureModel 3. No more hardcoded Anthropic model fallbacks
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 |
Summary of ChangesHello @JZilla808, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the capability to configure the language model used for ideation features within the application. By integrating the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request successfully makes the ideation model configurable by plumbing the SettingsService through to the ideation routes and services. The changes correctly fetch the configured model from settings with a fallback to a default value. I've identified one area of code duplication in IdeationService where fetching the model from settings is repeated. I've suggested refactoring this into a private helper method to improve maintainability. Otherwise, the changes look good and are consistent with the existing patterns in the codebase.
| let defaultModel = 'sonnet'; | ||
| if (this.settingsService) { | ||
| try { | ||
| const settings = await this.settingsService.getGlobalSettings(); | ||
| defaultModel = settings.phaseModels.ideationModel.model; | ||
| } catch (error) { | ||
| logger.warn('Failed to get settings for model selection, using default', error); | ||
| } | ||
| } |
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.
There's an opportunity to reduce code duplication. This block of code for fetching a model from settings is very similar to the one in the generateSuggestions method (lines 676-684).
Consider extracting this logic into a private helper method to improve maintainability. For example:
private async _getModelForPhase(phase: keyof PhaseModelConfig, fallback: string): Promise<string> {
if (!this.settingsService) {
return fallback;
}
try {
const settings = await this.settingsService.getGlobalSettings();
return settings.phaseModels[phase]?.model ?? fallback;
} catch (error) {
logger.warn(`Failed to get settings for ${phase} model, using default`, error);
return fallback;
}
}You could then use it like this in sendMessage:
const defaultModel = await this._getModelForPhase('ideationModel', 'sonnet');And in generateSuggestions:
const modelToUse = await this._getModelForPhase('suggestionsModel', 'sonnet');
Summary
This PR adds a dedicated
ideationModelsetting to give users granular control over which AI model powers the Ideation pane, distinct fromsuggestionsModel. It also fixes an issue where tasks created from ideation suggestions were not inheriting the correct model configuration.Problem
Previously:
suggestionsModelfor interactive brainstorming sessions, offering no separate configurationSolution
New
ideationModelSettingideationModelto thePhaseModelConfiginterface inlibs/types/src/settings.tssonnet) inDEFAULT_PHASE_MODELSideation-service.tsto useideationModelfor interactive chat sessionsTask Model Defaults Fix
add-suggestion.tsto retrievedefaultFeatureModelfrom user settingsFiles Changed
libs/types/src/settings.tsideationModelto interface and defaultsapps/ui/.../model-defaults-section.tsxapps/server/.../ideation-service.tsideationModelfor chat sessionsapps/server/.../add-suggestion.tsdefaultFeatureModelto created tasksapps/server/.../ideation/index.tssettingsServiceto route handlersTesting
npx tsc --noEmit)npm run build:packages)Notes
The dev server has a pre-existing
CachedInputFileSystemerror unrelated to these changes, which blocks local UI testing. Code correctness has been verified through type checking and build validation.