fix(cli): support image describe urls (#82854)

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Neerav Makwana
2026-05-17 00:06:27 -04:00
committed by GitHub
parent ab2943e2ff
commit 2c549ae205
10 changed files with 172 additions and 29 deletions

View File

@@ -1097,10 +1097,12 @@ async function runImageDescribe(params: {
const prompt = normalizeOptionalString(params.prompt);
const outputs = await Promise.all(
params.files.map(async (filePath) => {
const resolvedPath = path.resolve(filePath);
const isRemoteUrl = /^https?:\/\//i.test(filePath.trim());
const resolvedPath = isRemoteUrl ? filePath.trim() : path.resolve(filePath);
const result = activeModel
? await describeImageFileWithModel({
filePath: resolvedPath,
...(isRemoteUrl ? { mediaUrl: resolvedPath } : {}),
cfg,
agentDir,
provider: activeModel.provider,
@@ -1110,6 +1112,7 @@ async function runImageDescribe(params: {
})
: await describeImageFile({
filePath: resolvedPath,
...(isRemoteUrl ? { mediaUrl: resolvedPath } : {}),
cfg,
agentDir,
prompt,