summaryrefslogtreecommitdiff
path: root/internal/api/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/server.go')
-rw-r--r--internal/api/server.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/internal/api/server.go b/internal/api/server.go
index af4710b..6f343b6 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -26,6 +26,7 @@ type Server struct {
logger *slog.Logger
mux *http.ServeMux
claudeBinPath string // path to claude binary; defaults to "claude"
+ geminiBinPath string // path to gemini binary; defaults to "gemini"
elaborateCmdPath string // overrides claudeBinPath; used in tests
validateCmdPath string // overrides claudeBinPath for validate; used in tests
startNextTaskScript string // path to start-next-task script; overridden in tests
@@ -33,7 +34,7 @@ type Server struct {
workDir string // working directory injected into elaborate system prompt
}
-func NewServer(store *storage.DB, pool *executor.Pool, logger *slog.Logger, claudeBinPath string) *Server {
+func NewServer(store *storage.DB, pool *executor.Pool, logger *slog.Logger, claudeBinPath, geminiBinPath string) *Server {
wd, _ := os.Getwd()
s := &Server{
store: store,
@@ -44,6 +45,7 @@ func NewServer(store *storage.DB, pool *executor.Pool, logger *slog.Logger, clau
logger: logger,
mux: http.NewServeMux(),
claudeBinPath: claudeBinPath,
+ geminiBinPath: geminiBinPath,
workDir: wd,
}
s.routes()
@@ -276,7 +278,7 @@ func (s *Server) handleCreateTask(w http.ResponseWriter, r *http.Request) {
var input struct {
Name string `json:"name"`
Description string `json:"description"`
- Claude task.ClaudeConfig `json:"claude"`
+ Agent task.AgentConfig `json:"agent"`
Timeout string `json:"timeout"`
Priority string `json:"priority"`
Tags []string `json:"tags"`
@@ -292,7 +294,7 @@ func (s *Server) handleCreateTask(w http.ResponseWriter, r *http.Request) {
ID: uuid.New().String(),
Name: input.Name,
Description: input.Description,
- Claude: input.Claude,
+ Agent: input.Agent,
Priority: task.Priority(input.Priority),
Tags: input.Tags,
DependsOn: []string{},
@@ -302,6 +304,9 @@ func (s *Server) handleCreateTask(w http.ResponseWriter, r *http.Request) {
UpdatedAt: now,
ParentTaskID: input.ParentTaskID,
}
+ if t.Agent.Type == "" {
+ t.Agent.Type = "claude"
+ }
if t.Priority == "" {
t.Priority = task.PriorityNormal
}