From 054ec8b653b175917ef8bea45d55025e6775f187 Mon Sep 17 00:00:00 2001 From: Claudomator Agent Date: Mon, 16 Mar 2026 20:01:13 +0000 Subject: feat: add Project field to Task struct and YAML parsing Co-Authored-By: Claude Sonnet 4.6 --- internal/task/task.go | 1 + internal/task/task_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'internal/task') diff --git a/internal/task/task.go b/internal/task/task.go index b3660d3..3a04716 100644 --- a/internal/task/task.go +++ b/internal/task/task.go @@ -74,6 +74,7 @@ type Task struct { ParentTaskID string `yaml:"parent_task_id" json:"parent_task_id"` Name string `yaml:"name" json:"name"` Description string `yaml:"description" json:"description"` + Project string `yaml:"project" json:"project"` Agent AgentConfig `yaml:"agent" json:"agent"` Timeout Duration `yaml:"timeout" json:"timeout"` Retry RetryConfig `yaml:"retry" json:"retry"` diff --git a/internal/task/task_test.go b/internal/task/task_test.go index 15ba019..e6a17b8 100644 --- a/internal/task/task_test.go +++ b/internal/task/task_test.go @@ -100,3 +100,31 @@ func TestDuration_MarshalYAML(t *testing.T) { t.Errorf("expected '15m0s', got %v", v) } } + +func TestTask_ProjectField(t *testing.T) { + t.Run("struct assignment", func(t *testing.T) { + task := Task{Project: "my-project"} + if task.Project != "my-project" { + t.Errorf("expected Project 'my-project', got %q", task.Project) + } + }) + + t.Run("yaml parsing", func(t *testing.T) { + yaml := ` +name: "Test Task" +project: my-project +agent: + instructions: "Do something" +` + tasks, err := Parse([]byte(yaml)) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if len(tasks) != 1 { + t.Fatalf("expected 1 task, got %d", len(tasks)) + } + if tasks[0].Project != "my-project" { + t.Errorf("expected Project 'my-project', got %q", tasks[0].Project) + } + }) +} -- cgit v1.2.3