summaryrefslogtreecommitdiff
path: root/internal/task
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-08 21:03:50 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-08 21:03:50 +0000
commit632ea5a44731af94b6238f330a3b5440906c8ae7 (patch)
treed8c780412598d66b89ef390b5729e379fdfd9d5b /internal/task
parent406247b14985ab57902e8e42898dc8cb8960290d (diff)
parent93a4c852bf726b00e8014d385165f847763fa214 (diff)
merge: pull latest from master and resolve conflicts
- Resolve conflicts in API server, CLI, and executor. - Maintain Gemini classification and assignment logic. - Update UI to use generic agent config and project_dir. - Fix ProjectDir/WorkingDir inconsistencies in Gemini runner. - All tests passing after merge.
Diffstat (limited to 'internal/task')
-rw-r--r--internal/task/task.go26
-rw-r--r--internal/task/validator_test.go2
2 files changed, 25 insertions, 3 deletions
diff --git a/internal/task/task.go b/internal/task/task.go
index c6a321d..6b240dd 100644
--- a/internal/task/task.go
+++ b/internal/task/task.go
@@ -1,6 +1,9 @@
package task
-import "time"
+import (
+ "encoding/json"
+ "time"
+)
type State string
@@ -30,7 +33,7 @@ type AgentConfig struct {
Model string `yaml:"model" json:"model"`
ContextFiles []string `yaml:"context_files" json:"context_files"`
Instructions string `yaml:"instructions" json:"instructions"`
- WorkingDir string `yaml:"working_dir" json:"working_dir"`
+ ProjectDir string `yaml:"project_dir" json:"project_dir"`
MaxBudgetUSD float64 `yaml:"max_budget_usd" json:"max_budget_usd"`
PermissionMode string `yaml:"permission_mode" json:"permission_mode"`
AllowedTools []string `yaml:"allowed_tools" json:"allowed_tools"`
@@ -40,6 +43,25 @@ type AgentConfig struct {
SkipPlanning bool `yaml:"skip_planning" json:"skip_planning"`
}
+// UnmarshalJSON reads project_dir with fallback to legacy working_dir.
+func (c *AgentConfig) UnmarshalJSON(data []byte) error {
+ type Alias AgentConfig
+ aux := &struct {
+ ProjectDir string `json:"project_dir"`
+ WorkingDir string `json:"working_dir"` // legacy
+ *Alias
+ }{Alias: (*Alias)(c)}
+ if err := json.Unmarshal(data, aux); err != nil {
+ return err
+ }
+ if aux.ProjectDir != "" {
+ c.ProjectDir = aux.ProjectDir
+ } else {
+ c.ProjectDir = aux.WorkingDir
+ }
+ return nil
+}
+
type RetryConfig struct {
MaxAttempts int `yaml:"max_attempts" json:"max_attempts"`
Backoff string `yaml:"backoff" json:"backoff"` // "linear", "exponential"
diff --git a/internal/task/validator_test.go b/internal/task/validator_test.go
index 5678a00..657d93f 100644
--- a/internal/task/validator_test.go
+++ b/internal/task/validator_test.go
@@ -12,7 +12,7 @@ func validTask() *Task {
Agent: AgentConfig{
Type: "claude",
Instructions: "do something",
- WorkingDir: "/tmp",
+ ProjectDir: "/tmp",
},
Priority: PriorityNormal,
Retry: RetryConfig{MaxAttempts: 1, Backoff: "exponential"},