diff --git a/lib/crates/fabro-agent/src/config.rs b/lib/crates/fabro-agent/src/config.rs index dff155c52..63b831ab2 100644 --- a/lib/crates/fabro-agent/src/config.rs +++ b/lib/crates/fabro-agent/src/config.rs @@ -129,7 +129,7 @@ impl Default for SessionConfig { fn default() -> Self { Self { max_turns: 0, - max_tool_rounds_per_input: 200, + max_tool_rounds_per_input: 0, default_command_timeout_ms: 10_000, max_command_timeout_ms: 600_000, max_tokens: None, diff --git a/lib/crates/fabro-agent/src/session.rs b/lib/crates/fabro-agent/src/session.rs index 361ea6ed8..4504b5260 100644 --- a/lib/crates/fabro-agent/src/session.rs +++ b/lib/crates/fabro-agent/src/session.rs @@ -574,7 +574,9 @@ impl Session { loop { // Check max_tool_rounds_per_input - if round_count >= self.config.max_tool_rounds_per_input { + if self.config.max_tool_rounds_per_input > 0 + && round_count >= self.config.max_tool_rounds_per_input + { self.event_emitter.emit( self.id.clone(), AgentEvent::TurnLimitReached { diff --git a/lib/crates/fabro-agent/src/subagent.rs b/lib/crates/fabro-agent/src/subagent.rs index a1bfd21a8..98577973f 100644 --- a/lib/crates/fabro-agent/src/subagent.rs +++ b/lib/crates/fabro-agent/src/subagent.rs @@ -262,8 +262,8 @@ pub fn make_spawn_agent_tool( // Note: working_dir and model require session factory changes to wire through let mut session = session_factory(); - // Default subagent max_turns is 50 per spec (overridable via parameter) - session.set_max_turns(max_turns.unwrap_or(50)); + // Default subagent max_turns is 0 (unlimited) per spec (overridable via parameter) + session.set_max_turns(max_turns.unwrap_or(0)); let mut mgr = manager.lock().await; mgr.spawn(session, task.to_string(), current_depth) .map_err(|e| e.to_string())