mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user