fix(simulator): generate default values for input blocks in dry-run

When users click Simulate without providing input values,
AgentInputBlock.value is None and nothing gets yielded. This leaves
downstream blocks (like OrchestratorBlock) with unpopulated links,
causing them to be skipped entirely.

Fix: generate a sensible default — first dropdown option for
AgentDropdownInputBlock, or "sample {name}" for text inputs.
This commit is contained in:
Zamil Majdy
2026-03-29 06:26:03 +02:00
parent 3269d17880
commit 93264b1177

View File

@@ -395,8 +395,16 @@ async def simulate_block(
# AgentFileInputBlock, AgentShortTextInputBlock, etc.) yield
# "result" with the provided value.
value = input_data.get("value")
if value is not None:
yield "result", value
if value is None:
# Dry-run with no user input: generate a sensible default so
# downstream blocks (e.g. OrchestratorBlock) still receive data.
placeholder = input_data.get("placeholder_values")
if placeholder and isinstance(placeholder, list) and placeholder:
value = placeholder[0] # First dropdown option
else:
name = input_data.get("name", "input")
value = f"sample {name}"
yield "result", value
return
if isinstance(block, AgentOutputBlock):