fix(backend): inherit dry_run from execution_context in child graph validation

When AgentExecutorBlock spawns a child graph execution, it passes
execution_context (with dry_run=True) but the dry_run parameter
defaults to False. This caused validate_and_construct_node_execution_input
to reject missing credentials in the sub-agent, even though dry-run
should skip credential validation.

Fix: derive dry_run from execution_context.dry_run when an execution_context
is provided. Also propagate simulation_context to child graphs.
This commit is contained in:
Zamil Majdy
2026-03-26 20:17:25 +07:00
parent 646ffe1693
commit 5d489c72b5

View File

@@ -928,6 +928,14 @@ async def add_graph_execution(
execution_context.parent_execution_id if execution_context else None
)
# When execution_context is provided (e.g. from AgentExecutorBlock),
# inherit dry_run and simulation_context so child-graph validation
# skips credential checks and simulated blocks get the same hints.
if execution_context and execution_context.dry_run:
dry_run = True
if simulation_context is None and execution_context.simulation_context:
simulation_context = execution_context.simulation_context
# Validate simulation_context *before* creating any DB records so we
# don't leave orphaned INCOMPLETE graph_execution rows on failure.
_SIMULATION_CONTEXT_MAX_BYTES = 16 * 1024