Skip to content

Extract a shared resolveDefaultModel helper - #389

Merged
TheGreatAxios merged 1 commit into
mainfrom
worktree-agent-a3fe0563e9664e4a3
Aug 8, 2026
Merged

Extract a shared resolveDefaultModel helper#389
TheGreatAxios merged 1 commit into
mainfrom
worktree-agent-a3fe0563e9664e4a3

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • The defaultModel-or-first-model fallback rule was independently reimplemented at src/config/providers.ts:86, src/config/inference-sources.ts:43, and src/config/settings.ts:1074, with the rule documented only as a comment
  • Added resolveDefaultModel in src/config/providers.ts and wired all three call sites to it, so the active and backup model for a provider can no longer diverge

Test plan

  • bun test src/config/providers.test.ts (new resolveDefaultModel cases, RED before implementation, GREEN after)
  • bun run typecheck (no new errors introduced)
  • bun run build
  • bun run test (4143 pass, 1 pre-existing unrelated failure in lsp-availability.test.ts due to missing devDependencies in this worktree)

…lback

The defaultModel-or-first-model precedence was hand-rolled at three call
sites (providers.ts:86, inference-sources.ts:43, settings.ts:1074), so a
rule change at one site wouldn't apply at the others and the active and
backup model for the same provider could diverge.
@TheGreatAxios
TheGreatAxios merged commit dc81262 into main Aug 8, 2026
3 checks passed
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.

1 participant