fix: stuff

This commit is contained in:
pavel 2026-02-11 00:56:33 +01:00
commit 39143e1998
5 changed files with 69 additions and 12 deletions

View file

@ -71,8 +71,16 @@ impl Agent {
pub async fn run(&mut self) -> Result<(String, Option<String>), Box<dyn std::error::Error>> {
let mut finished = false;
let start_time = Instant::now();
let max_duration = Duration::from_secs(120);
let max_turns = 20;
let max_duration_secs = std::env::var("AGENT_MAX_DURATION_SECS")
.ok()
.and_then(|s| s.parse().ok())
.unwrap_or(120);
let max_duration = Duration::from_secs(max_duration_secs);
let max_turns = std::env::var("AGENT_MAX_TURNS")
.ok()
.and_then(|s| s.parse().ok())
.unwrap_or(20);
let mut turns = 0;
while !finished {