Skip to content

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

Improve plan execution with better progress reporting

Dane Schneidera9eb94041b01
diff --git a/app/cli/plan_exec/action_menu.go b/app/cli/plan_exec/action_menu.go
index 3061927b..b18be65d 100644
--- a/app/cli/plan_exec/action_menu.go
+++ b/app/cli/plan_exec/action_menu.go
@@ -84,20 +84,26 @@ func showHotkeyMenu(diffs []string) {
}
numDiffs := len(diffs)
- s := "files have"
- if numDiffs == 1 {
- s = "file has"
+ if hasApplyScript {
+ numDiffs--
}
- color.New(color.Bold, term.ColorHiGreen).Printf("🧐 %d %s pending changes\n", numDiffs, s)
- for _, diff := range diffs {
- if diff == "_apply.sh" {
- continue
+ if numDiffs > 0 {
+ s := "files have"
+ if numDiffs == 1 {
+ s = "file has"
}
+ color.New(color.Bold, term.ColorHiGreen).Printf("🧐 %d %s pending changes\n", numDiffs, s)
+
+ for _, diff := range diffs {
+ if diff == "_apply.sh" {
+ continue
+ }
- fmt.Printf("β€’ πŸ“„ %s\n", diff)
+ fmt.Printf("β€’ πŸ“„ %s\n", diff)
+ }
+ fmt.Println()
}
- fmt.Println()
if hasApplyScript {
color.New(color.Bold, term.ColorHiYellow).Println("πŸš€ Commands pending")
diff --git a/app/cli/plan_exec/build.go b/app/cli/plan_exec/build.go
index 222a7d15..ec2d048b 100644
--- a/app/cli/plan_exec/build.go
+++ b/app/cli/plan_exec/build.go
@@ -83,7 +83,7 @@ func Build(params ExecParams, flags types.BuildFlags) (bool, error) {
ch := make(chan error)
go func() {
- err := streamtui.StartStreamUI("", true)
+ err := streamtui.StartStreamUI("", true, !flags.AutoApply)
if err != nil {
ch <- fmt.Errorf("error starting stream UI: %v", err)
diff --git a/app/cli/plan_exec/tell.go b/app/cli/plan_exec/tell.go
index c9f64f8c..5a955399 100644
--- a/app/cli/plan_exec/tell.go
+++ b/app/cli/plan_exec/tell.go
@@ -55,7 +55,6 @@ func TellPlan(
}
term.StartSpinner("")
- log.Println("Getting context (ListContext)")
contexts, apiErr := api.Client.ListContext(params.CurrentPlanId, params.CurrentBranch)
if apiErr != nil {
@@ -63,10 +62,6 @@ func TellPlan(
term.OutputErrorAndExit("Error getting context: %v", apiErr)
}
- log.Println("Got context (ListContext)")
-
- log.Println("Getting project paths")
-
paths, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))
if err != nil {
@@ -74,9 +69,6 @@ func TellPlan(
term.OutputErrorAndExit("Error getting project paths: %v", err)
}
- log.Println("Got project paths")
-
- log.Println("Checking outdated context (CheckOutdatedContext)")
anyOutdated, didUpdate, err := params.CheckOutdatedContext(contexts, paths)
if err != nil {
@@ -84,8 +76,6 @@ func TellPlan(
term.OutputErrorAndExit("Error checking outdated context: %v", err)
}
- log.Println("Checked outdated context (CheckOutdatedContext)")
-
if anyOutdated && !didUpdate {
term.StopSpinner()
if isUserContinue {
@@ -194,7 +184,11 @@ func TellPlan(
if !tellBg {
go func() {
- err := streamtui.StartStreamUI(prompt, false)
+ err := streamtui.StartStreamUI(
+ prompt,
+ false,
+ !(autoApply || autoContext || isApplyDebug || isDebugCmd),
+ )
if err != nil {
outputPromptIfTell()
@@ -208,12 +202,14 @@ func TellPlan(
} else if autoApply || isDebugCmd || isApplyDebug {
// do nothing, allow auto apply to run
} else {
+ term.StartSpinner("")
diffs, apiErr := getDiffs(params)
- numDiffs := len(diffs)
+ term.StopSpinner()
if apiErr != nil {
term.OutputErrorAndExit("Error getting plan diffs: %v", apiErr.Msg)
return
}
+ numDiffs := len(diffs)
hasDiffs := numDiffs > 0
fmt.Println()