fix: preserve session provider context in fallback chain (#2295)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { describe, test, expect } from "bun:test"
|
||||
declare const require: (name: string) => any
|
||||
const { describe, test, expect } = require("bun:test")
|
||||
import { buildFallbackChainFromModels, parseFallbackModelEntry } from "./fallback-chain-from-models"
|
||||
|
||||
describe("fallback-chain-from-models", () => {
|
||||
@@ -32,6 +33,21 @@ describe("fallback-chain-from-models", () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("uses opencode as absolute fallback provider when context provider is missing", () => {
|
||||
//#given
|
||||
const fallbackModel = "gemini-3-flash"
|
||||
|
||||
//#when
|
||||
const parsed = parseFallbackModelEntry(fallbackModel, undefined)
|
||||
|
||||
//#then
|
||||
expect(parsed).toEqual({
|
||||
providers: ["opencode"],
|
||||
model: "gemini-3-flash",
|
||||
variant: undefined,
|
||||
})
|
||||
})
|
||||
|
||||
test("builds fallback chain from normalized fallback_models input", () => {
|
||||
//#given
|
||||
const fallbackModels = ["quotio/kimi-k2.5", "gpt-5.2 medium"]
|
||||
|
||||
Reference in New Issue
Block a user