Skip to content

fix(engine): wire plan_execute_config through auto-selection path in AgentEngine #578

@Aureliolo

Description

@Aureliolo

Problem

AgentEngine._resolve_loop() calls build_execution_loop() without passing plan_execute_config. This means PlanExecuteLoop instances created via auto-selection always use default PlanExecuteConfig() -- there is no way to customize planner_model, executor_model, or max_replans through the agent engine when using auto-selection.

Affected code

src/synthorg/engine/agent_engine.py lines ~1062-1066:

return build_execution_loop(
    loop_type,
    approval_gate=self._approval_gate,
    stagnation_detector=self._stagnation_detector,
    # Missing: plan_execute_config=...
)

Impact

Users cannot configure plan-execute loop behavior (model tiering, replan limits) when using auto-selection. The build_execution_loop() factory accepts plan_execute_config but it is never passed from the agent engine.

Similarly, hybrid_loop_config was wired through in #199, but only at the AgentEngine.__init__ level -- a more comprehensive solution should allow per-task or per-complexity config overrides.

Fix

Add plan_execute_config parameter to AgentEngine.__init__ and pass through in _resolve_loop(), matching the pattern used for hybrid_loop_config.

Discovered during #199 (Hybrid execution loop implementation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:mediumShould do, but not blockingscope:smallLess than 1 day of workspec:agent-systemDESIGN_SPEC Section 3 - Agent Systemtype:fixBug fixes and corrections

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions