fix(backend): always yield result pin in MCP simulation success path

The success path now explicitly yields ("result", ...) from the parsed
response rather than iterating all pins with a None/empty filter.
This prevents downstream starvation when the LLM legitimately returns
null for side-effect-only tool results.
This commit is contained in:
Zamil Majdy
2026-03-29 11:43:14 +02:00
parent 842ff6c600
commit 84d328517a

View File

@@ -369,9 +369,11 @@ async def simulate_mcp_block(
try:
parsed = await _call_llm_for_simulation(system_prompt, user_prompt, label=label)
for pin_name, pin_value in parsed.items():
if pin_value is not None and pin_value != "":
yield pin_name, pin_value
# Always yield "result" so downstream nodes are never starved.
yield "result", parsed.get("result")
error_val = parsed.get("error")
if error_val is not None and error_val != "":
yield "error", error_val
except (RuntimeError, ValueError) as e:
# Yield both pins so downstream nodes connected to "result" aren't starved.
yield "result", None