fix(simulator): preserve traditional mode in dry-run preparation

prepare_dry_run now respects agent_mode_max_iterations=0 (traditional
mode) instead of unconditionally forcing agent mode. Only overrides
to 1 when the user configured agent mode (non-zero).
This commit is contained in:
Zamil Majdy
2026-03-27 13:14:51 +07:00
parent 390324d5a1
commit 6ab9a3285f

View File

@@ -287,10 +287,16 @@ def prepare_dry_run(block: Any, input_data: dict[str, Any]) -> dict[str, Any] |
block should be LLM-simulated instead.
"""
if isinstance(block, OrchestratorBlock):
# Preserve the user's configured mode: 0 means traditional (single
# LLM call, no agent loop). Only override to 1 when the user chose
# agent mode (non-zero) so the dry run still exercises the loop once
# without running away.
original = input_data.get("agent_mode_max_iterations", 0)
max_iters = 1 if original != 0 else 0
return {
**input_data,
"model": DRY_RUN_MODEL,
"agent_mode_max_iterations": 1,
"agent_mode_max_iterations": max_iters,
}
return None