feat(chat): model override per conversation via inline selector - #554
Merged
Conversation
esafwan
force-pushed
the
feat/chat-model-switching
branch
from
August 1, 2026 11:15
3216c0f to
3e50974
Compare
- Add a pill-style AgentModelSelector variant showing current agent name + model. - Render the selector inside ChatInput's bottom toolbar, similar to Claude/ChatGPT. - Switching agent on a new chat updates the ?agent= param; switching on an existing conversation starts a fresh chat, preserving the pinned model rule. - Filter chat-enabled agents and model-selector agents to only those whose provider exists in AI Provider (fail-open on permission errors). - Extend useChatAgentIdentity to expose agent display name and model.
- Backend resolves effective provider/model from an AI Model override. - New set_conversation_model_override API persists the choice on the conversation. - Chat input forwards model_override to sync/stream, audio, and file uploads. - Frontend loads models on mount so the pill reflects the override even when closed. - Blocks modality-mismatched switches and warns that provider cache may reset.
esafwan
force-pushed
the
feat/chat-model-switching
branch
from
August 1, 2026 13:01
3e50974 to
4bc42c3
Compare
… key-gating - Add get_configured_providers whitelist to only return AI providers that have a decrypted API key or are local LLMs - Filter AI Model list in getAIModels() so only models from configured providers are offered - Add provider chip filter row and modality badges to AgentModelSelector - Allow searching by modality and keep catalog loaded for closed pill state
- Parse JSON body once in agent stream renderer so model_override is read reliably - Resolve provider from override model in streaming renderer for cross-provider switches - Include normalized_model in streaming LiteLLM error sanitization so users see specific messages (e.g. model unavailable)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The inline agent/model selector in the chat input now switches the model/provider for the current agent within the same conversation, instead of jumping to a different agent.
How
AgentManager/run_agent_sync/run_agent_stream: when a model override is supplied, the effective provider andmodel_nameare resolved from the AI Model doc.set_conversation_model_overridewhitelisted API to persist (or clear) the override on the Agent Conversation.model_overridethroughnew_conversation,send_message_to_conversation, audio transcription, file upload/prepare, and the streaming renderer.Verification
chat-model-switchingworktree bench at http://localhost:8002.Notes