fix(agents): replace anyOf with string in image tool schema

Anthropic's API rejects `anyOf` in `input_schema`, causing all Claude
requests to fail when the image tool is registered. Replace
`Type.Union([Type.String(), Type.Array(Type.String())])` with
`Type.String()` — the execute handler already normalizes both string
and array inputs, so this is schema-only.

Fixes #18551
This commit is contained in:
HAL
2026-02-16 15:03:47 -06:00
committed by Peter Steinberger
parent 6d31d1ecc6
commit e8b03a8622

View File

@@ -376,7 +376,7 @@ export function createImageTool(options?: {
description,
parameters: Type.Object({
prompt: Type.Optional(Type.String()),
image: Type.Union([Type.String(), Type.Array(Type.String())]),
image: Type.String({ description: "Image path or URL (pass multiple as comma-separated)" }),
model: Type.Optional(Type.String()),
maxBytesMb: Type.Optional(Type.Number()),
maxImages: Type.Optional(Type.Number()),