Repository navigation
feat: unify AI default model resolution - #68
Merged
Merged
Conversation
- Add resolveDefaultModel(provider) to utils.ts with updated built-in defaults (claude-sonnet-4-6, gpt-5-mini, gemini-3-flash-preview) and DEFAULT_<PROVIDER>_MODEL env var overrides - All provider files (claude, openai, gemini, custom) now call resolveDefaultModel instead of their own stale hardcoded constants, so every code path — getAIProvider, getAIStatus, testAIConfig, testVisionCapability — uses the same model precedence: explicit request > saved user setting > env override > built-in fallback - resolveAIConfig injects resolveDefaultModel when user has no saved model - envConfigFor injects resolveDefaultModel when ANTHROPIC/OPENAI/GEMINI_MODEL env vars are not set - Add DEFAULT_CLAUDE_MODEL / DEFAULT_OPENAI_MODEL / DEFAULT_GEMINI_MODEL / DEFAULT_CUSTOM_MODEL to .env.example - Document AI Model Defaults section in docs/self-hosting.md - Add unit tests for resolveDefaultModel with/without env overrides Co-authored-by: hacksynth <hacksynth@users.noreply.github.com>
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.
Refresh built-in AI default models and add DEFAULT__MODEL overrides across env config, saved user settings, provider fallback, and connection-test paths, with docs and tests for precedence.
Closes #58