Remove parent task update
Change-Id: Ib2ede7fa2b652cfe225f5c83449c2e0b1c374fb0
diff --git a/MVP_README.md b/MVP_README.md
index a88f8e4..64cf604 100644
--- a/MVP_README.md
+++ b/MVP_README.md
@@ -88,7 +88,7 @@
```bash
# Task Management
./staff create-task <description> [--priority high|medium|low] [--agent <agent-name>]
-./staff list-tasks [--status pending|in_progress|completed]
+./staff list-tasks [--status in_progress|completed]
./staff assign-task <task-id> <agent-name>
# Agent Management
@@ -130,7 +130,7 @@
**ID**: task-001
**Priority**: high
**Agent**: backend-engineer
-**Status**: pending
+**Status**: todo
## Description
Implement a complete user authentication system with:
diff --git a/server/agent/manager.go b/server/agent/manager.go
index a302133..191d42e 100644
--- a/server/agent/manager.go
+++ b/server/agent/manager.go
@@ -275,7 +275,7 @@
slog.String("agent", agent.Name))
for _, task := range tasks {
- if task.Status == tm.StatusToDo || task.Status == tm.StatusPending {
+ if task.Status == tm.StatusToDo {
if err := m.processTask(agent, task); err != nil {
m.logger.Error("Error processing task",
slog.String("task_id", task.ID),
@@ -315,9 +315,6 @@
// Mark task as in progress
task.Status = tm.StatusInProgress
agent.CurrentTask = &task.ID
- if err := m.taskManager.UpdateTask(task); err != nil {
- return fmt.Errorf("failed to update task status: %w", err)
- }
// Check if this task should generate subtasks (with LLM decision)
if m.shouldGenerateSubtasks(task) {
@@ -326,19 +323,7 @@
m.logger.Warn("Failed to generate subtasks for task",
slog.String("task_id", task.ID),
slog.String("error", err.Error()))
- // Continue with normal processing if subtask generation fails
} else {
- // Task has been converted to subtask management, mark as completed
- task.Status = tm.StatusCompleted
- task.Solution = "Task analyzed by LLM and broken down into subtasks with potential new agent creation. See subtasks PR for details."
- completedAt := time.Now()
- task.CompletedAt = &completedAt
- agent.CurrentTask = nil
-
- if err := m.taskManager.UpdateTask(task); err != nil {
- return fmt.Errorf("failed to update task with subtasks: %w", err)
- }
-
m.logger.Info("Task converted to subtasks by agent using LLM analysis",
slog.String("task_id", task.ID),
slog.String("agent", agent.Name))
@@ -364,18 +349,6 @@
return fmt.Errorf("failed to create pull request: %w", err)
}
- // Update task as completed
- task.Status = tm.StatusCompleted
- task.Solution = solution
- task.PullRequestURL = prURL
- completedAt := time.Now()
- task.CompletedAt = &completedAt
- agent.CurrentTask = nil
-
- if err := m.taskManager.UpdateTask(task); err != nil {
- return fmt.Errorf("failed to update completed task: %w", err)
- }
-
// Update agent stats
duration := time.Since(startTime)
if agent.Stats.AvgTime == 0 {
@@ -717,12 +690,7 @@
return task.Priority == tm.PriorityHigh || len(task.Description) > 200
}
- // Update task to mark as evaluated
task.SubtasksEvaluated = true
- if err := m.taskManager.UpdateTask(task); err != nil {
- m.logger.Warn("Failed to update task evaluation status", slog.String("error", err.Error()))
- }
-
m.logger.Info("LLM subtask decision for task",
slog.String("task_id", task.ID),
slog.Bool("needs_subtasks", decision.NeedsSubtasks),
diff --git a/server/tm/README.md b/server/tm/README.md
index 6b6e62d..4be9d02 100644
--- a/server/tm/README.md
+++ b/server/tm/README.md
@@ -14,7 +14,7 @@
### Types (`types.go`)
- **Task**: The main task entity with all task properties
-- **TaskStatus**: Enum for task states (pending, in progress, completed, etc.)
+- **TaskStatus**: Enum for task states (in progress, completed, etc.)
- **TaskPriority**: Enum for task priorities (low, medium, high, urgent)
- **Owner**: Represents a task owner
diff --git a/server/tm/types.go b/server/tm/types.go
index 980be44..a9991b4 100644
--- a/server/tm/types.go
+++ b/server/tm/types.go
@@ -9,7 +9,6 @@
const (
StatusToDo TaskStatus = "todo"
- StatusPending TaskStatus = "pending" // For MVP compatibility
StatusInProgress TaskStatus = "in_progress"
StatusCompleted TaskStatus = "completed"
StatusFailed TaskStatus = "failed" // For error handling
@@ -42,18 +41,18 @@
Priority TaskPriority `json:"priority"`
Solution string `json:"solution,omitempty"` // Generated solution
PullRequestURL string `json:"pull_request_url,omitempty"` // GitHub PR URL
-
+
// Subtask support
- ParentTaskID string `json:"parent_task_id,omitempty"` // ID of parent task if this is a subtask
- SubtasksPRURL string `json:"subtasks_pr_url,omitempty"` // PR URL for proposed subtasks
- SubtasksGenerated bool `json:"subtasks_generated"` // Whether subtasks have been generated
- SubtasksEvaluated bool `json:"subtasks_evaluated"` // Whether task has been evaluated for subtasks
-
- CreatedAt time.Time `json:"created_at"`
- UpdatedAt time.Time `json:"updated_at"`
- DueDate *time.Time `json:"due_date,omitempty"`
- CompletedAt *time.Time `json:"completed_at,omitempty"`
- ArchivedAt *time.Time `json:"archived_at,omitempty"`
+ ParentTaskID string `json:"parent_task_id,omitempty"` // ID of parent task if this is a subtask
+ SubtasksPRURL string `json:"subtasks_pr_url,omitempty"` // PR URL for proposed subtasks
+ SubtasksGenerated bool `json:"subtasks_generated"` // Whether subtasks have been generated
+ SubtasksEvaluated bool `json:"subtasks_evaluated"` // Whether task has been evaluated for subtasks
+
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+ DueDate *time.Time `json:"due_date,omitempty"`
+ CompletedAt *time.Time `json:"completed_at,omitempty"`
+ ArchivedAt *time.Time `json:"archived_at,omitempty"`
}
// TaskFilter represents filters for querying tasks
@@ -97,13 +96,13 @@
// SubtaskProposal represents a proposed subtask from LLM analysis
type SubtaskProposal struct {
- Title string `json:"title"`
- Description string `json:"description"`
- Priority TaskPriority `json:"priority"`
- AssignedTo string `json:"assigned_to"` // Suggested agent role
- EstimatedHours int `json:"estimated_hours,omitempty"`
- Dependencies []string `json:"dependencies,omitempty"` // IDs of other subtasks this depends on
- RequiredSkills []string `json:"required_skills,omitempty"` // Skills needed for this subtask
+ Title string `json:"title"`
+ Description string `json:"description"`
+ Priority TaskPriority `json:"priority"`
+ AssignedTo string `json:"assigned_to"` // Suggested agent role
+ EstimatedHours int `json:"estimated_hours,omitempty"`
+ Dependencies []string `json:"dependencies,omitempty"` // IDs of other subtasks this depends on
+ RequiredSkills []string `json:"required_skills,omitempty"` // Skills needed for this subtask
}
// SubtaskDecision represents LLM's decision about whether a task needs subtasks
@@ -116,19 +115,19 @@
// AgentCreationProposal represents a proposal to create a new agent
type AgentCreationProposal struct {
- Role string `json:"role"`
- Skills []string `json:"skills"`
- Description string `json:"description"`
- Justification string `json:"justification"`
+ Role string `json:"role"`
+ Skills []string `json:"skills"`
+ Description string `json:"description"`
+ Justification string `json:"justification"`
}
// SubtaskAnalysis represents the LLM's analysis and proposed subtasks
type SubtaskAnalysis struct {
- ParentTaskID string `json:"parent_task_id"`
- AnalysisSummary string `json:"analysis_summary"`
- Subtasks []SubtaskProposal `json:"subtasks"`
- AgentCreations []AgentCreationProposal `json:"agent_creations,omitempty"` // New agents needed
- RecommendedApproach string `json:"recommended_approach"`
- EstimatedTotalHours int `json:"estimated_total_hours"`
- RiskAssessment string `json:"risk_assessment,omitempty"`
+ ParentTaskID string `json:"parent_task_id"`
+ AnalysisSummary string `json:"analysis_summary"`
+ Subtasks []SubtaskProposal `json:"subtasks"`
+ AgentCreations []AgentCreationProposal `json:"agent_creations,omitempty"` // New agents needed
+ RecommendedApproach string `json:"recommended_approach"`
+ EstimatedTotalHours int `json:"estimated_total_hours"`
+ RiskAssessment string `json:"risk_assessment,omitempty"`
}