Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
improve prompting around subtasks/current subtask for context/planning to hopefully improve following of instructions for current stage
Dane Schneider0d7444288421
diff --git a/app/server/model/plan/tell_subtasks.go b/app/server/model/plan/tell_subtasks.goindex 9ab4881b..25e400b5 100644--- a/app/server/model/plan/tell_subtasks.go+++ b/app/server/model/plan/tell_subtasks.go@@ -5,6 +5,7 @@ import ("log""plandex-server/db""plandex-server/model/parse"+ shared "plandex-shared""strings""github.com/davecgh/go-spew/spew"@@ -36,7 +37,7 @@ func (state *activeTellStreamState) formatSubtasks() string {}subtasksText += "\n"- if state.currentSubtask != nil && subtask.Title == state.currentSubtask.Title {+ if state.currentSubtask != nil && subtask.Title == state.currentSubtask.Title && state.currentStage.TellStage == shared.TellStageImplementation {current = subtasksubtasksText += "Current subtask: yes"}@@ -44,7 +45,7 @@ func (state *activeTellStreamState) formatSubtasks() string {subtasksText += "\n"}- if current != nil {+ if current != nil && state.currentStage.TellStage == shared.TellStageImplementation {subtasksText += fmt.Sprintf("\n### Current subtask\n%s\n", current.Title)if current.Description != "" {subtasksText += "\n" + current.Description + "\n"@@ -57,6 +58,20 @@ func (state *activeTellStreamState) formatSubtasks() string {}subtasksText += strings.Join(usesFiles, ", ") + "\n"}+ } else if state.currentStage.TellStage == shared.TellStagePlanning {+ if state.currentStage.PlanningPhase == shared.PlanningPhasePlanning {+ subtasksText += `++ Remember, you are in the *PLANNING* phase and ABSOLUTELY MUST NOT implement any of the subtasks. You MUST NOT write any code or create any files. You can ONLY add or remove subtasks with a '### Tasks' section or a '### Remove Tasks' section. You CANNOT implement any of the subtasks in this response. Follow the PLANNING instructions. The existing subtasks are included for your reference so that you can see what has been planned so far, what has been done, and what is left to do, so that you can add or remove subtasks as needed. DO NOT implement any of the subtasks in this response-follow the instructions for the PLANNING phase.++ `+ } else if state.currentStage.PlanningPhase == shared.PlanningPhaseContext {+ subtasksText += `++ Remember, you are in the *CONTEXT* phase. You MUST NOT implement any of the subtasks. You MUST NOT write any code or create any files. You MUST NOT make a plan with a '### Tasks' section or a '### Remove Tasks' section. Follow the instructions for the CONTEXT phase-they are summarized for you in the [SUMMARY OF INSTRUCTIONS] section. The existing subtasks are included for your reference so that you can see what has been planned so far, what has been done, and what is left to do. DO NOT implement any of the subtasks in this response Do NOT add or remove subtasks. Follow the instructions for the CONTEXT phase.++ `+ }}return subtasksText