Skip to content

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

more work on control flow/context flow/stage detection/subtasks

Dane Schneider3fbb34279dae
diff --git a/app/server/model/plan/tell_state.go b/app/server/model/plan/tell_state.go
index e4cf14a2..66baaa70 100644
--- a/app/server/model/plan/tell_state.go
+++ b/app/server/model/plan/tell_state.go
@@ -50,7 +50,8 @@ type activeTellStreamState struct {
isPlanningStage bool
isImplementationStage bool
- isFollowUp bool
+ isFollowUp bool
+ willLoadFollowUpContext bool
chunkProcessor *chunkProcessor
diff --git a/app/server/model/plan/tell_subtasks.go b/app/server/model/plan/tell_subtasks.go
index b05f31ef..b2caa95f 100644
--- a/app/server/model/plan/tell_subtasks.go
+++ b/app/server/model/plan/tell_subtasks.go
@@ -62,11 +62,11 @@ func (state *activeTellStreamState) formatSubtasks() string {
return subtasksText
}
-func (state *activeTellStreamState) checkNewSubtasks() bool {
+func (state *activeTellStreamState) checkNewSubtasks() []*db.Subtask {
activePlan := GetActivePlan(state.plan.Id, state.branch)
if activePlan == nil {
- return false
+ return nil
}
content := activePlan.CurrentReplyContent
@@ -75,7 +75,7 @@ func (state *activeTellStreamState) checkNewSubtasks() bool {
if len(subtasks) == 0 {
log.Println("No new subtasks found")
- return false
+ return nil
}
log.Println("Found new subtasks:")
@@ -91,22 +91,24 @@ func (state *activeTellStreamState) checkNewSubtasks() bool {
}
var newSubtasks []*db.Subtask
+ var updatedSubtasks []*db.Subtask
// Keep finished subtasks
for _, subtask := range state.subtasks {
if subtask.IsFinished {
- newSubtasks = append(newSubtasks, subtask)
+ updatedSubtasks = append(updatedSubtasks, subtask)
}
}
- // Add new subtasks if they don't exist or if existing one was finished
+ // Add new subtasks if they don't exist
for _, subtask := range subtasks {
if subtasksByName[subtask.Title] == nil {
newSubtasks = append(newSubtasks, subtask)
+ updatedSubtasks = append(updatedSubtasks, subtask)
}
}
- state.subtasks = newSubtasks
+ state.subtasks = updatedSubtasks
var currentSubtaskName string
if state.currentSubtask != nil {
@@ -137,5 +139,5 @@ func (state *activeTellStreamState) checkNewSubtasks() bool {
// log.Println("state.subtasks:\n", spew.Sdump(state.subtasks))
// log.Println("state.currentSubtask:\n", spew.Sdump(state.currentSubtask))
- return true
+ return newSubtasks
}