Skip to content

Commit 827c303

Browse files
committed
fix: set max_tool_iterations=10 in test build_agent
Fix agent_respects_max_tool_iterations test by explicitly setting max_tool_iterations to 10 in build_agent helper function. The default value was changed from 10 to 25, causing this test to fail as it expected the limit to be 10 iterations.
1 parent b829ebe commit 827c303

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/agent_loop_robustness.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,18 @@ fn tool_response(calls: Vec<ToolCall>) -> ChatResponse {
199199
}
200200

201201
fn build_agent(provider: Box<dyn Provider>, tools: Vec<Box<dyn Tool>>) -> Agent {
202+
use zerobuild::config::AgentConfig;
202203
Agent::builder()
203204
.provider(provider)
204205
.tools(tools)
205206
.memory(make_memory())
206207
.observer(make_observer())
207208
.tool_dispatcher(Box::new(NativeToolDispatcher))
208209
.workspace_dir(std::env::temp_dir())
210+
.config(AgentConfig {
211+
max_tool_iterations: 10,
212+
..AgentConfig::default()
213+
})
209214
.build()
210215
.unwrap()
211216
}

0 commit comments

Comments
 (0)