From 75d9644d44ba998a32ed14c072e883a75145ab72 Mon Sep 17 00:00:00 2001 From: soryu Date: Fri, 16 Jan 2026 19:50:27 +0000 Subject: Add autopilot panel and retry system --- makima/src/db/models.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'makima/src/db/models.rs') diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs index 0e1303c..72ba6f2 100644 --- a/makima/src/db/models.rs +++ b/makima/src/db/models.rs @@ -6,6 +6,11 @@ use sqlx::FromRow; use utoipa::ToSchema; use uuid::Uuid; +/// Default max retries for task daemon failover (3 attempts) +fn default_max_retries() -> i32 { + 3 +} + /// Flexible datetime deserialization module. /// Accepts both date-only ("2026-01-15") and full ISO 8601 datetime ("2026-01-15T00:00:00Z") formats. pub mod flexible_datetime { @@ -500,6 +505,20 @@ pub struct Task { /// Files to copy from parent task's worktree when starting. #[serde(skip_serializing_if = "Option::is_none")] pub copy_files: Option, + + // Retry tracking for daemon failover + /// Number of times this task has been retried after daemon failure + #[serde(default)] + pub retry_count: i32, + /// Maximum retry attempts before marking as permanently failed + #[serde(default = "default_max_retries")] + pub max_retries: i32, + /// Array of daemon IDs that have failed this task (excluded from retry) + #[serde(skip_serializing_if = "Option::is_none")] + pub failed_daemon_ids: Option>, + /// When the task was last interrupted due to daemon disconnect + #[serde(skip_serializing_if = "Option::is_none")] + pub interrupted_at: Option>, } impl Task { -- cgit v1.2.3