Skip to content

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

bit of refactoring of exec status call

Dane Schneidera06fd31a5698
diff --git a/app/server/model/plan/exec_status.go b/app/server/model/plan/exec_status.go
index 1a2e3e43..3d73e8c3 100644
--- a/app/server/model/plan/exec_status.go
+++ b/app/server/model/plan/exec_status.go
@@ -9,11 +9,17 @@ import (
"strings"
"github.com/davecgh/go-spew/spew"
- "github.com/plandex/plandex/shared"
"github.com/sashabaranov/go-openai"
)
-func ExecStatusShouldContinue(client *openai.Client, config shared.ModelRoleConfig, prompt, message string, ctx context.Context) (bool, error) {
+func (state *activeTellStreamState) execStatusShouldContinue(prompt, message string, ctx context.Context) (bool, error) {
+ settings := state.settings
+ clients := state.clients
+ config := settings.ModelPack.ExecStatus
+
+ envVar := config.BaseModelConfig.ApiKeyEnvVar
+ client := clients[envVar]
+
log.Println("Checking if plan should continue based on exec status")
// First try to determine if the plan should continue based on the last paragraph without calling the model
diff --git a/app/server/model/plan/tell_stream.go b/app/server/model/plan/tell_stream.go
index 7e349372..d61cd9c7 100644
--- a/app/server/model/plan/tell_stream.go
+++ b/app/server/model/plan/tell_stream.go
@@ -268,10 +268,7 @@ func (state *activeTellStreamState) listenStream(stream *openai.ChatCompletionSt
prompt = promptMessage.Content
}
- envVar := state.settings.ModelPack.ExecStatus.BaseModelConfig.ApiKeyEnvVar
- client := clients[envVar]
-
- shouldContinue, err = ExecStatusShouldContinue(client, settings.ModelPack.ExecStatus, prompt, assistantMsg.Message, active.Ctx)
+ shouldContinue, err = state.execStatusShouldContinue(prompt, assistantMsg.Message, active.Ctx)
if err != nil {
state.onError(fmt.Errorf("failed to get exec status: %v", err), false, assistantMsg.Id, convoCommitMsg)
errCh <- err