From cb2aa9a73163ce392d7c3f1dd81888b039312a67 Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 24 Jan 2026 00:52:28 +0000 Subject: feat: Add maximum iterations limit for autonomous loop mode Adds configurable iteration limits to prevent runaway autonomous loops and provide predictable behavior, inspired by Ralph's design patterns. Changes: - Add AutonomousLoopConfig to daemon config with: - default_max_iterations: 10 (default for new tasks) - hard_limit: 50 (absolute maximum that cannot be exceeded) - no_change_threshold: 3 (consecutive runs without progress) - same_error_threshold: 5 (consecutive runs with same error) - Add max_iterations and iteration_count fields to Task model - Add iteration_limit_reached status to TaskStatus enum - Pass max_iterations through DaemonCommand::SpawnTask - Apply limits in CircuitBreaker during autonomous loop execution When a task hits the iteration limit: - Task status is set to "iteration_limit_reached" (not "failed") - Clear message is logged about hitting the limit - Task can be resumed with a higher limit if needed Co-Authored-By: Claude Opus 4.5 --- makima/src/bin/makima.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'makima/src/bin') diff --git a/makima/src/bin/makima.rs b/makima/src/bin/makima.rs index 96dc252..b82ad62 100644 --- a/makima/src/bin/makima.rs +++ b/makima/src/bin/makima.rs @@ -242,6 +242,7 @@ async fn run_daemon( api_key: config.server.api_key.clone(), heartbeat_commit_interval_secs: config.process.heartbeat_commit_interval_secs, checkpoint_patches: config.process.checkpoint_patches.clone(), + autonomous_loop_config: config.autonomous_loop.clone(), }; // Create task manager with local database for crash recovery -- cgit v1.2.3