-
Notifications
You must be signed in to change notification settings - Fork 49
ai-assistant: Fix model selection issues #459
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
Conversation
399d92c to
0218624
Compare
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.
Pull request overview
This PR addresses model selection issues in the AI assistant by introducing a centralized resolveSelectedModel function and adding input sanitization for provider configurations. The changes aim to improve the robustness of model selection by prioritizing explicit model choices, falling back to saved configurations, and finally defaulting to provider-specific models.
Key Changes:
- Introduced
resolveSelectedModelfunction to centralize model selection logic with fallback hierarchy - Added sanitization of configuration values (API keys, endpoints, models) to handle trailing whitespace
- Modified history preservation behavior when switching providers (now appends instead of clearing)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ai-assistant/src/modal.tsx | Adds resolveSelectedModel function and updates model selection logic across initialization and provider switching; changes history handling to preserve chat history when switching configurations |
| ai-assistant/src/langchain/LangChainManager.ts | Implements sanitization logic for all configuration values to trim whitespace from strings before passing to AI provider clients |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e390b26 to
5b55986
Compare
Signed-off-by: Evangelos Skopelitis <[email protected]>
Signed-off-by: Evangelos Skopelitis <[email protected]>
Signed-off-by: Evangelos Skopelitis <[email protected]>
Signed-off-by: Evangelos Skopelitis <[email protected]>
5b55986 to
962bc07
Compare
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
illume
left a 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.
🎉 thanks!
These changes address some problems with model selection. The AI Assistant now:
Fixes: #364