fix(doctor): align auto-update and doctor config paths
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { afterEach, beforeEach, describe, expect, mock, spyOn, test } from "bun:test"
|
||||
declare const require: (name: string) => any
|
||||
const { afterEach, beforeEach, describe, expect, mock, spyOn, test } = require("bun:test")
|
||||
import { resolveModelForDelegateTask } from "./model-selection"
|
||||
import * as connectedProvidersCache from "../../shared/connected-providers-cache"
|
||||
|
||||
@@ -22,7 +23,7 @@ describe("resolveModelForDelegateTask", () => {
|
||||
})
|
||||
|
||||
describe("#when availableModels is empty and no user model override", () => {
|
||||
test("#then returns undefined to let OpenCode use system default", () => {
|
||||
test("#then returns skipped sentinel to leave model unpinned", () => {
|
||||
const result = resolveModelForDelegateTask({
|
||||
categoryDefaultModel: "anthropic/claude-sonnet-4-6",
|
||||
fallbackChain: [
|
||||
@@ -32,7 +33,7 @@ describe("resolveModelForDelegateTask", () => {
|
||||
systemDefaultModel: "anthropic/claude-sonnet-4-6",
|
||||
})
|
||||
|
||||
expect(result).toBeUndefined()
|
||||
expect(result).toEqual({ skipped: true })
|
||||
})
|
||||
})
|
||||
|
||||
@@ -53,7 +54,7 @@ describe("resolveModelForDelegateTask", () => {
|
||||
})
|
||||
|
||||
describe("#when user set fallback_models but no cache exists", () => {
|
||||
test("#then returns undefined (skip fallback resolution without cache)", () => {
|
||||
test("#then returns skipped sentinel (skip fallback resolution without cache)", () => {
|
||||
const result = resolveModelForDelegateTask({
|
||||
userFallbackModels: ["openai/gpt-5.4", "google/gemini-3.1-pro"],
|
||||
categoryDefaultModel: "anthropic/claude-sonnet-4-6",
|
||||
@@ -63,7 +64,7 @@ describe("resolveModelForDelegateTask", () => {
|
||||
availableModels: new Set(),
|
||||
})
|
||||
|
||||
expect(result).toBeUndefined()
|
||||
expect(result).toEqual({ skipped: true })
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -85,8 +86,7 @@ describe("resolveModelForDelegateTask", () => {
|
||||
systemDefaultModel: "anthropic/claude-sonnet-4-6",
|
||||
})
|
||||
|
||||
expect(result).toBeDefined()
|
||||
expect(result!.model).toBe("anthropic/claude-sonnet-4-6")
|
||||
expect(result).toEqual({ model: "anthropic/claude-sonnet-4-6" })
|
||||
})
|
||||
})
|
||||
|
||||
@@ -100,8 +100,7 @@ describe("resolveModelForDelegateTask", () => {
|
||||
availableModels: new Set(["anthropic/claude-sonnet-4-6"]),
|
||||
})
|
||||
|
||||
expect(result).toBeDefined()
|
||||
expect(result!.model).toBe("anthropic/claude-sonnet-4-6")
|
||||
expect(result).toEqual({ model: "anthropic/claude-sonnet-4-6" })
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user