Add subtasks
Change-Id: Ica6afd9eef38bcf29135bf2c8a2e4bf0407ccfa1
diff --git a/server/llm/fake/fake.go b/server/llm/fake/fake.go
index 3739c27..3735821 100644
--- a/server/llm/fake/fake.go
+++ b/server/llm/fake/fake.go
@@ -3,6 +3,7 @@
import (
"context"
"fmt"
+ "strings"
"time"
"github.com/iomodo/staff/llm"
@@ -128,6 +129,63 @@
4. Implementation kickoff
This solution ensures long-term success while delivering immediate value to the organization.`,
+
+ `{
+ "analysis_summary": "This task requires a comprehensive multi-phase approach involving frontend, backend, and infrastructure components. The complexity suggests breaking it into specialized subtasks for different team members.",
+ "subtasks": [
+ {
+ "title": "Design System Architecture",
+ "description": "Create detailed technical architecture diagrams, define API contracts, and establish database schema design",
+ "priority": "high",
+ "assigned_to": "ceo",
+ "estimated_hours": 12,
+ "dependencies": []
+ },
+ {
+ "title": "Backend API Development",
+ "description": "Implement core backend services, API endpoints, authentication middleware, and data validation layers",
+ "priority": "high",
+ "assigned_to": "ceo",
+ "estimated_hours": 24,
+ "dependencies": ["0"]
+ },
+ {
+ "title": "Database Setup and Migration",
+ "description": "Set up database infrastructure, create migration scripts, establish indexes, and implement backup procedures",
+ "priority": "medium",
+ "assigned_to": "ceo",
+ "estimated_hours": 8,
+ "dependencies": ["0"]
+ },
+ {
+ "title": "Frontend Interface Implementation",
+ "description": "Build user interface components, implement state management, integrate with backend APIs, and ensure responsive design",
+ "priority": "high",
+ "assigned_to": "ceo",
+ "estimated_hours": 32,
+ "dependencies": ["1"]
+ },
+ {
+ "title": "Testing and Quality Assurance",
+ "description": "Develop comprehensive test suites including unit tests, integration tests, and end-to-end testing scenarios",
+ "priority": "medium",
+ "assigned_to": "ceo",
+ "estimated_hours": 16,
+ "dependencies": ["1", "3"]
+ },
+ {
+ "title": "Deployment and Documentation",
+ "description": "Set up CI/CD pipeline, deploy to staging environment, create user documentation, and prepare production deployment",
+ "priority": "low",
+ "assigned_to": "ceo",
+ "estimated_hours": 10,
+ "dependencies": ["4"]
+ }
+ ],
+ "recommended_approach": "Start with architecture design to establish clear foundations, then proceed with parallel backend and database development. Once backend APIs are stable, begin frontend implementation while maintaining continuous testing throughout the process.",
+ "estimated_total_hours": 102,
+ "risk_assessment": "Main risks include scope creep, API integration complexity, and potential database performance issues. Mitigation strategies include regular stakeholder reviews, comprehensive API documentation, and early performance testing."
+}`,
}
return &FakeProvider{
@@ -141,9 +199,24 @@
// Simulate API delay
time.Sleep(500 * time.Millisecond)
- // Get the next response (cycle through responses)
- response := f.responses[f.index%len(f.responses)]
- f.index++
+ // Check if this is a subtask analysis request
+ isSubtaskRequest := false
+ for _, msg := range req.Messages {
+ if strings.Contains(msg.Content, "subtasks") || strings.Contains(msg.Content, "JSON") {
+ isSubtaskRequest = true
+ break
+ }
+ }
+
+ var response string
+ if isSubtaskRequest && len(f.responses) > 3 {
+ // Always use the JSON subtask response for subtask requests
+ response = f.responses[3] // The JSON response is at index 3
+ } else {
+ // Get the next response (cycle through responses)
+ response = f.responses[f.index%len(f.responses)]
+ f.index++
+ }
return &llm.ChatCompletionResponse{
ID: fmt.Sprintf("fake-response-%d", f.index),