fix: gate sticker vision on image input

This commit is contained in:
Ayaan Zaidi
2026-01-27 13:42:40 +05:30
committed by Ayaan Zaidi
parent a49250fffc
commit d7a00dc823
3 changed files with 4 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ async function resolveStickerVisionSupport(params: {
});
const entry = findModelInCatalog(catalog, defaultModel.provider, defaultModel.model);
if (!entry) return false;
return entry.input ? modelSupportsVision(entry) : true;
return modelSupportsVision(entry);
} catch {
return false;
}

View File

@@ -27,7 +27,7 @@ async function resolveStickerVisionSupport(cfg, agentId) {
const defaultModel = resolveDefaultModelForAgent({ cfg, agentId });
const entry = findModelInCatalog(catalog, defaultModel.provider, defaultModel.model);
if (!entry) return false;
return entry.input ? modelSupportsVision(entry) : true;
return modelSupportsVision(entry);
} catch {
return false;
}

View File

@@ -165,7 +165,7 @@ export async function describeStickerImage(params: DescribeStickerParams): Promi
try {
catalog = await loadModelCatalog({ config: cfg });
const entry = findModelInCatalog(catalog, defaultModel.provider, defaultModel.model);
const supportsVision = entry?.input ? modelSupportsVision(entry) : Boolean(entry);
const supportsVision = modelSupportsVision(entry);
if (supportsVision) {
activeModel = { provider: defaultModel.provider, model: defaultModel.model };
}
@@ -185,8 +185,7 @@ export async function describeStickerImage(params: DescribeStickerParams): Promi
const selectCatalogModel = (provider: string) => {
const entries = catalog.filter(
(entry) =>
entry.provider.toLowerCase() === provider.toLowerCase() &&
(entry.input ? modelSupportsVision(entry) : true),
entry.provider.toLowerCase() === provider.toLowerCase() && modelSupportsVision(entry),
);
if (entries.length === 0) return undefined;
const defaultId =