Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/vision/eligibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ function modelAcceptsImageInputWithCache(
): boolean | undefined {
if (candidate.native === true || (candidate.provider === "openai" && SUPPORTED_NATIVE_OPENAI_SLUGS.has(candidate.id))) {
const nativeProvider = enrichedProviderForVision(config, candidate.provider, cache);
if (nativeProvider && isModelVisionSidecarConsumer({
noVisionModels: nativeProvider.noVisionModels, modelInputModalities: nativeProvider.modelInputModalities,
}, candidate.id)) return false;
if (nativeProvider && isModelVisionSidecarConsumer(nativeProvider, candidate.id)) return false;
const declared = Object.hasOwn(nativeProvider?.modelCapabilities ?? {}, candidate.id)
? nativeProvider?.modelCapabilities?.[candidate.id]?.inputModalities : undefined;
if (declared !== undefined) return declared.includes("image");
return advertisesImageInput(nativeInputModalities(candidate.id)) ?? true;
}
if (isVisionSidecarConsumerWithCache(config, candidate.provider, candidate.id, cache)) return false;
Expand Down
36 changes: 36 additions & 0 deletions tests/vision/vision-eligibility.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,42 @@ describe("vision eligibility core", () => {
})).toBe(false);
});

test("15. native model declared text-only via modelCapabilities is disqualified from vision describer eligibility (#4501)", () => {
const config = configWithProviders({
openai: {
adapter: "openai-responses",
baseUrl: "https://chatgpt.com/backend-api/codex",
modelCapabilities: {
"gpt-5.4-mini": { inputModalities: ["text"] },
},
},
});
const candidate: VisionCandidateModel = {
provider: "openai",
id: "gpt-5.4-mini",
};
expect(modelAcceptsImageInput(config, candidate)).toBe(false);
expect(isVisionEligibleModel(config, candidate)).toBe(false);
});

test("16. native model baseline declared text-only via modelCapabilities drops the baseline option (#4501)", () => {
const config = configWithProviders({
openai: {
adapter: "openai-responses",
baseUrl: "https://chatgpt.com/backend-api/codex",
modelCapabilities: {
[BASELINE_VISION_MODELS.openai]: { inputModalities: ["text"] },
},
},
anthropic: {
adapter: "anthropic",
baseUrl: "https://api.anthropic.com",
},
});
const options = visionEligibleModelOptions(config, [], ["openai", "anthropic"], "anthropic");
expect(options.map(o => o.value)).toEqual([BASELINE_VISION_MODELS.anthropic]);
});

test("5. openai baseline is present when that side is enabled", () => {
const options = visionEligibleModelOptions(emptyConfig, [], ["openai"]);
expect(options.map((o) => o.value)).toEqual([BASELINE_VISION_MODELS.openai]);
Expand Down
Loading