Skip to content

Conversation

@skoeva
Copy link
Contributor

@skoeva skoeva commented Dec 4, 2025

These changes address some problems with model selection. The AI Assistant now:

  • Uses the model selected in settings within the plugin UI
  • Persists the chatbox and conversation history across model changes
  • Cleans up sanitization of config inputs

Fixes: #364

@skoeva skoeva self-assigned this Dec 4, 2025
@skoeva skoeva marked this pull request as ready for review December 4, 2025 22:08
Copy link

Copilot AI left a 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 resolveSelectedModel function 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.

@skoeva skoeva force-pushed the model-selection branch 2 times, most recently from e390b26 to 5b55986 Compare December 11, 2025 16:10
Copy link

Copilot AI left a 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.

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 thanks!

@illume illume merged commit c1eb877 into main Jan 6, 2026
15 checks passed
@illume illume deleted the model-selection branch January 6, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ai-assistant: Model selection problems

4 participants