Default max_tool_rounds_per_input and subagent max_turns to unlimited

Align with attractor spec update: both limits now default to 0
(unlimited) instead of 200 and 50 respectively. The
max_tool_rounds_per_input loop check now guards on > 0 so that 0
means no limit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-23 12:40:09 -04:00
parent 57d0317d7f
commit 0897a917ec
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View file

@ -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,

View file

@ -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 {

View file

@ -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())