From 6f03ceeb887a152dcfdb85267213626724eab3a1 Mon Sep 17 00:00:00 2001 From: Zamil Majdy Date: Thu, 2 Apr 2026 10:10:06 +0200 Subject: [PATCH] fix(blocks): validate AgentExecutorBlock inputs against nested inputs dict get_missing_input() and get_mismatch_error() were checking required fields from the inner agent's input_schema against the top-level node data keys (inputs, user_id, graph_id, etc.) instead of against data["inputs"] where the actual field values live. This caused any AgentExecutorBlock with required inner-agent inputs to fail validation with "This field is required" even when the values were correctly provided in the inputs dict. --- autogpt_platform/backend/backend/blocks/agent.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/autogpt_platform/backend/backend/blocks/agent.py b/autogpt_platform/backend/backend/blocks/agent.py index 42ade5c50a..a4e5acff07 100644 --- a/autogpt_platform/backend/backend/blocks/agent.py +++ b/autogpt_platform/backend/backend/blocks/agent.py @@ -49,11 +49,17 @@ class AgentExecutorBlock(Block): @classmethod def get_missing_input(cls, data: BlockInput) -> set[str]: required_fields = cls.get_input_schema(data).get("required", []) - return set(required_fields) - set(data) + # Check against the nested `inputs` dict, not the top-level node + # data — required fields like "topic" live inside data["inputs"], + # not at data["topic"]. + provided = data.get("inputs", {}) + return set(required_fields) - set(provided) @classmethod def get_mismatch_error(cls, data: BlockInput) -> str | None: - return validate_with_jsonschema(cls.get_input_schema(data), data) + return validate_with_jsonschema( + cls.get_input_schema(data), data.get("inputs", {}) + ) class Output(BlockSchema): # Use BlockSchema to avoid automatic error field that could clash with graph outputs