diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-07 23:53:15 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-08 05:18:41 +0000 |
| commit | ebdb12fc37c9c8db460827fdba1aa10e5b208cb9 (patch) | |
| tree | b0f4b12e9251b836e6efef283c9b7ad959c9692f /internal/api | |
| parent | f11f1f8c7d3ce9caca592323def9cc598e5c7392 (diff) | |
feat(wiring): configure GeminiRunner and update API server
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/server.go | 11 |
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 } |
