fix(look-at): preserve variant metadata in fallback chain and block non-vision models
- fallback-chain.ts: cache-derived entries inherit variant from matching hardcoded entries - agent-metadata.ts: new isVisionCapableAgentModel() guard blocks non-vision registered models - tools.ts: early vision-capability check before session creation - Added regression tests for variant preservation and non-vision model rejection
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { describe, expect, it } from "bun:test"
|
||||
|
||||
describe("buildMultimodalLookerFallbackChain", () => {
|
||||
it("builds fallback chain from vision-capable models", async () => {
|
||||
// given
|
||||
@@ -28,4 +30,20 @@ describe("buildMultimodalLookerFallbackChain", () => {
|
||||
expect(result[0].model).toBe("gpt-5.4")
|
||||
expect(result[0].providers).toContain("openai")
|
||||
})
|
||||
|
||||
it("preserves hardcoded variant metadata for cache-derived entries", async () => {
|
||||
// given
|
||||
const { buildMultimodalLookerFallbackChain } = await import("./multimodal-fallback-chain")
|
||||
const visionCapableModels = [{ providerID: "openai", modelID: "gpt-5.4" }]
|
||||
|
||||
// when
|
||||
const result = buildMultimodalLookerFallbackChain(visionCapableModels)
|
||||
|
||||
// then
|
||||
expect(result[0]).toEqual({
|
||||
providers: ["openai"],
|
||||
model: "gpt-5.4",
|
||||
variant: "medium",
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user