Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

Update plan handlers to use new parameter structures

Dane Schneiderc3b7cc19a759
diff --git a/app/server/handlers/plans_changes.go b/app/server/handlers/plans_changes.go
index dcacdbf0..6ea3a498 100644
--- a/app/server/handlers/plans_changes.go
+++ b/app/server/handlers/plans_changes.go
@@ -184,7 +184,7 @@ func ApplyPlanHandler(w http.ResponseWriter, r *http.Request) {
log.Println("ApplyPlanHandler: Got current plan state:", currentPlan != nil)
- clients := initClients(
+ res := initClients(
initClientsParams{
w: w,
auth: auth,
@@ -195,7 +195,19 @@ func ApplyPlanHandler(w http.ResponseWriter, r *http.Request) {
},
)
- commitMsg, err := modelPlan.GenCommitMsgForPendingResults(auth, plan, clients, settings, currentPlan, requestBody.SessionId, r.Context())
+ clients := res.clients
+ authVars := res.authVars
+
+ commitMsg, err := modelPlan.GenCommitMsgForPendingResults(modelPlan.GenCommitMsgForPendingResultsParams{
+ Auth: auth,
+ Plan: plan,
+ Clients: clients,
+ Settings: settings,
+ Current: currentPlan,
+ AuthVars: authVars,
+ SessionId: requestBody.SessionId,
+ Ctx: r.Context(),
+ })
if err != nil {
log.Printf("Error generating commit message: %v\n", err)
diff --git a/app/server/handlers/plans_exec.go b/app/server/handlers/plans_exec.go
index 9b527102..c2e430e7 100644
--- a/app/server/handlers/plans_exec.go
+++ b/app/server/handlers/plans_exec.go
@@ -69,7 +69,7 @@ func TellPlanHandler(w http.ResponseWriter, r *http.Request) {
return
}
- clients := initClients(
+ res := initClients(
initClientsParams{
w: w,
auth: auth,
@@ -79,7 +79,14 @@ func TellPlanHandler(w http.ResponseWriter, r *http.Request) {
plan: plan,
},
)
- err = modelPlan.Tell(clients, plan, branch, auth, &requestBody)
+ err = modelPlan.Tell(modelPlan.TellParams{
+ Clients: res.clients,
+ Plan: plan,
+ Branch: branch,
+ Auth: auth,
+ Req: &requestBody,
+ AuthVars: res.authVars,
+ })
if err != nil {
log.Printf("Error telling plan: %v\n", err)
@@ -132,7 +139,7 @@ func BuildPlanHandler(w http.ResponseWriter, r *http.Request) {
return
}
- clients := initClients(
+ res := initClients(
initClientsParams{
w: w,
auth: auth,
@@ -142,7 +149,14 @@ func BuildPlanHandler(w http.ResponseWriter, r *http.Request) {
plan: plan,
},
)
- numBuilds, err := modelPlan.Build(clients, requestBody.AuthVars, plan, branch, auth, requestBody.SessionId)
+ numBuilds, err := modelPlan.Build(modelPlan.BuildParams{
+ Clients: res.clients,
+ AuthVars: res.authVars,
+ Plan: plan,
+ Branch: branch,
+ Auth: auth,
+ SessionId: requestBody.SessionId,
+ })
if err != nil {
log.Printf("Error building plan: %v\n", err)