diff --git a/src/daemon/spawner.py b/src/daemon/spawner.py index 6f61194..05b3051 100644 --- a/src/daemon/spawner.py +++ b/src/daemon/spawner.py @@ -561,6 +561,10 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_ retry_counts = self._get_retry_counts(db_path, task_id) count = retry_counts.get(retry_field, 0) + 1 + # 更新计数器并写回最新 attempt 的 metadata + retry_counts[retry_field] = count + self._update_retry_counts(db_path, task_id, retry_counts) + if count >= self.max_retries: logger.error("Agent %s max retries (session=%s, %s=%d)", agent_id, session_id, retry_field, count)