Skip to content

feat: unify AI default model resolution - #68

Merged
hacksynth merged 1 commit into
mainfrom
claude/issue-58-20260502-1628
May 2, 2026
Merged

hacksynth merged 1 commit into
mainfrom
claude/issue-58-20260502-1628

Conversation

@hacksynth

Copy link
Copy Markdown
Owner

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

- 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>
@hacksynth
hacksynth merged commit b119e96 into main May 2, 2026
12 checks passed
@hacksynth
hacksynth deleted the claude/issue-58-20260502-1628 branch May 3, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh stale default AI models and allow environment overrides

1 participant