diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/api/elaborate.go | 2 | ||||
| -rw-r--r-- | internal/api/elaborate_test.go | 9 | ||||
| -rw-r--r-- | internal/api/stories.go | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/internal/api/elaborate.go b/internal/api/elaborate.go index b6bc4e5..dd51c7d 100644 --- a/internal/api/elaborate.go +++ b/internal/api/elaborate.go @@ -170,7 +170,7 @@ func readProjectContext(workDir string) string { return "" } var sb strings.Builder - for _, filename := range []string{"CLAUDE.md", "SESSION_STATE.md"} { + for _, filename := range []string{"CLAUDE.md", ".agent/worklog.md"} { path := filepath.Join(workDir, filename) if data, err := os.ReadFile(path); err == nil { if sb.Len() > 0 { diff --git a/internal/api/elaborate_test.go b/internal/api/elaborate_test.go index 5216bcd..32cec3c 100644 --- a/internal/api/elaborate_test.go +++ b/internal/api/elaborate_test.go @@ -390,14 +390,17 @@ func createFakeClaudeCapturingArgs(t *testing.T, output string, exitCode int, ar func TestElaborateTask_WithProjectContext(t *testing.T) { srv, _ := testServer(t) - // Create a temporary workspace with CLAUDE.md and SESSION_STATE.md + // Create a temporary workspace with CLAUDE.md and .agent/worklog.md workDir := t.TempDir() claudeContent := "Claude context info" sessionContent := "Session state info" if err := os.WriteFile(filepath.Join(workDir, "CLAUDE.md"), []byte(claudeContent), 0600); err != nil { t.Fatal(err) } - if err := os.WriteFile(filepath.Join(workDir, "SESSION_STATE.md"), []byte(sessionContent), 0600); err != nil { + if err := os.MkdirAll(filepath.Join(workDir, ".agent"), 0700); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(workDir, ".agent", "worklog.md"), []byte(sessionContent), 0600); err != nil { t.Fatal(err) } @@ -438,7 +441,7 @@ func TestElaborateTask_WithProjectContext(t *testing.T) { t.Errorf("expected arguments to contain CLAUDE.md content, got %s", argsStr) } if !strings.Contains(argsStr, sessionContent) { - t.Errorf("expected arguments to contain SESSION_STATE.md content, got %s", argsStr) + t.Errorf("expected arguments to contain .agent/worklog.md content, got %s", argsStr) } } diff --git a/internal/api/stories.go b/internal/api/stories.go index 2f26040..fcf8c48 100644 --- a/internal/api/stories.go +++ b/internal/api/stories.go @@ -253,6 +253,7 @@ func (s *Server) handleApproveStory(w http.ResponseWriter, r *http.Request) { t := &task.Task{ ID: uuid.New().String(), Name: tp.Name, + Project: input.ProjectID, StoryID: story.ID, Agent: task.AgentConfig{Type: "claude", Instructions: tp.Instructions}, Priority: task.PriorityNormal, @@ -277,6 +278,7 @@ func (s *Server) handleApproveStory(w http.ResponseWriter, r *http.Request) { st := &task.Task{ ID: uuid.New().String(), Name: sub.Name, + Project: input.ProjectID, StoryID: story.ID, ParentTaskID: t.ID, Agent: task.AgentConfig{Type: "claude", Instructions: sub.Instructions}, |
