From b19597808ddd36840248146c99d54fbd58074914 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 13 Jan 2026 10:05:46 +0800 Subject: [PATCH] Refactor Execution Status and Agent State Enums in Design Document - Renamed the `Status` type to `ExecStatus` for clarity in execution status representation. - Introduced a new `AgentState` type to define the operational states of the agent, enhancing the structure of the design document. - Updated relevant sections to reflect these changes, improving overall readability and understanding of the agent's execution and operational context. --- agent/autonomous/DESIGN.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/agent/autonomous/DESIGN.md b/agent/autonomous/DESIGN.md index 4cf34bc2..04082b01 100644 --- a/agent/autonomous/DESIGN.md +++ b/agent/autonomous/DESIGN.md @@ -397,14 +397,23 @@ const ( DeliveryNotify DeliveryType = "notify" ) -// Status - execution status enum -type Status string +// ExecStatus - execution status enum +type ExecStatus string const ( - StatusPending Status = "pending" - StatusRunning Status = "running" - StatusCompleted Status = "completed" - StatusFailed Status = "failed" + ExecPending ExecStatus = "pending" + ExecRunning ExecStatus = "running" + ExecCompleted ExecStatus = "completed" + ExecFailed ExecStatus = "failed" +) + +// AgentState - agent operational state enum +type AgentState string + +const ( + AgentActive AgentState = "active" // ready to run + AgentPaused AgentState = "paused" // manually paused + AgentRunning AgentState = "running" // currently executing ) // Triggers - all on by default @@ -766,13 +775,13 @@ type EventRequest struct { } type ExecutionResult struct { - ExecutionID string // Job execution ID - Status Status + ExecutionID string // Job execution ID + Status ExecStatus // pending | running | completed | failed } type AgentStatus struct { AgentID string - Status string // active | paused | running + State AgentState // active | paused | running LastRun time.Time NextRun time.Time RunningID string // current execution ID if running