summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/task/task.go1
-rw-r--r--internal/task/task_test.go28
2 files changed, 29 insertions, 0 deletions
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)
+ }
+ })
+}