-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When fetchServerProviders() returns server-configured providers, the LLM auto-select logic only triggers when state.modelId is empty (line 887). But users with stale localStorage data may have a non-empty modelId pointing to a provider with no API key (neither client-provided nor server-configured).
How It Happens
- User previously selected a model like
openai:gpt-4o(stored in localStorage) - The v0→v1 migration only clears
modelIdwhen it's exactlygpt-4o-mini(line 952-955), missing other model IDs fetchServerProviders()runs but skips auto-select becausemodelIdis not empty- Generation APIs use the stale
openai:gpt-4o→ server has no OpenAI key →"API key required for provider: openai"
Root Cause
lib/store/settings.ts line 887 — auto-select condition !state.modelId is too narrow. It should also trigger when the current provider is not usable (no client key AND not server-configured).
Suggested Fix
In fetchServerProviders(), also auto-select when the current providerId has requiresApiKey but has no client key and is not isServerConfigured.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working