Skip to content

Commit 7be166f

Browse files
suryaiyer95claude
andcommitted
fix: prioritize altimate-backend over recent models in fallback chain
Move the altimate-backend provider check before the recent models loop so Altimate AI is selected when credentials are configured, even if other providers were used previously. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2024619 commit 7be166f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • packages/opencode/src/cli/cmd/tui/context

packages/opencode/src/cli/cmd/tui/context/local.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
172172
}
173173
}
174174

175-
for (const item of modelStore.recent) {
176-
if (isModelValid(item)) {
177-
return item
178-
}
179-
}
180-
181175
// Prefer altimate-backend when configured
182176
const altimateProvider = sync.data.provider.find((x) => x.id === "altimate-backend")
183177
if (altimateProvider) {
@@ -190,6 +184,12 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
190184
}
191185
}
192186

187+
for (const item of modelStore.recent) {
188+
if (isModelValid(item)) {
189+
return item
190+
}
191+
}
192+
193193
const provider = sync.data.provider[0]
194194
if (!provider) return undefined
195195
const defaultModel = sync.data.provider_default[provider.id]

0 commit comments

Comments
 (0)