From f9d21138e8908e8fd466fd94ff4c46a418fb59e3 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:51:02 +0000 Subject: [PATCH] fix(blocks): add json_schema_extra for images field to prevent frontend crash When clicking '+ Item' on the Images input field, the frontend was crashing with: TypeError: Cannot read properties of undefined (reading 'type') This was caused by the frontend not being able to determine what type of items to add to the Optional[List[MediaFileType]] array. Added explicit JSON schema with array type and string items with URI format to provide the frontend with the necessary type information. Co-authored-by: Bently --- .../backend/backend/blocks/ai_image_customizer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autogpt_platform/backend/backend/blocks/ai_image_customizer.py b/autogpt_platform/backend/backend/blocks/ai_image_customizer.py index 4d87f1e41d..1c40f925c3 100644 --- a/autogpt_platform/backend/backend/blocks/ai_image_customizer.py +++ b/autogpt_platform/backend/backend/blocks/ai_image_customizer.py @@ -64,6 +64,10 @@ class AIImageCustomizerBlock(Block): description="List of input images (optional)", default=None, title="Images", + json_schema_extra={ + "type": "array", + "items": {"type": "string", "format": "uri"}, + }, ) output_format: OutputFormat = SchemaField( description="Format of the output image",