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
fix auto-continue prompt that describes implementation phase during planning phase
Dane Schneider62bcf84e1cb4
diff --git a/app/server/model/plan/tell_prompt_message.go b/app/server/model/plan/tell_prompt_message.goindex 87a0eb35..5de3ea02 100644--- a/app/server/model/plan/tell_prompt_message.go+++ b/app/server/model/plan/tell_prompt_message.go@@ -146,12 +146,10 @@ func (state *activeTellStreamState) resolvePromptMessage(var prompt stringif iteration == 0 {prompt = req.Prompt+ } else if state.currentStage.TellStage == shared.TellStageImplementation {+ prompt = prompts.AutoContinueImplementationPrompt} else {- prompt = prompts.AutoContinuePrompt- }-- if state.currentStage.TellStage == shared.TellStageImplementation {- prompt = prompts.AutoContinuePrompt+ prompt = prompts.AutoContinuePlanningPrompt}state.userPrompt = promptdiff --git a/app/server/model/plan/tell_summary.go b/app/server/model/plan/tell_summary.goindex f210ee1d..32aac060 100644--- a/app/server/model/plan/tell_summary.go+++ b/app/server/model/plan/tell_summary.go@@ -331,7 +331,7 @@ func summarizeConvo(clients map[string]model.ClientInfo, config shared.ModelRolelog.Println("generating summary - latestMessageSummarizedAt:", latestMessageSummarizedAt)if userPrompt != "" {- if userPrompt != prompts.UserContinuePrompt && userPrompt != prompts.AutoContinuePrompt {+ if userPrompt != prompts.UserContinuePrompt && userPrompt != prompts.AutoContinuePlanningPrompt && userPrompt != prompts.AutoContinueImplementationPrompt {summaryMessages = append(summaryMessages, &types.ExtendedChatMessage{Role: openai.ChatMessageRoleUser,Content: []types.ExtendedChatMessagePart{diff --git a/app/server/model/prompts/user_prompt.go b/app/server/model/prompts/user_prompt.goindex 9fb6f711..3104ca0b 100644--- a/app/server/model/prompts/user_prompt.go+++ b/app/server/model/prompts/user_prompt.go@@ -80,7 +80,7 @@ IMPORTANT: During this planning phase, you must NOT implement any code or createDo not attempt to write any code or show any implementation details at this stage.-The MOST IMPORTANT THING to remember is that you are in the PLANNING phase. Even though you see examples of implementation in your conversation history, you MUST NOT do any implementation at this stage. Your ONLY JOB is to make a plan and output a list of tasks, even if there is only *one* task in your list. That is your ONLY JOB at this stage. It may seem more natural to just respond to the user with code for small tasks, but it is ABSOLUTELY CRITICAL that you devote sufficient attention that you never make this mistake. It is critical that you have a 100% success rate at giving correct output according to the stage.+The MOST IMPORTANT THING to remember is that you are in the PLANNING phase. Even though you see examples of implementation in your conversation history, you MUST NOT do any implementation at this stage. Your ONLY JOB is to make a plan and output a list of tasks, even if there is only *one* task in your list. That is your ONLY JOB at this stage. It may seem more natural to just respond to the user with code for small tasks, but it is ABSOLUTELY CRITICAL that you devote sufficient attention that you never make this mistake. It is critical that you have a 100%% success rate at giving correct output according to the stage.`if params.IsUserDebug {@@ -268,7 +268,18 @@ func GetWrappedPrompt(params UserPromptParams) string {ts := time.Now().Format(time.RFC3339)- s := fmt.Sprintf(promptWrapperFormatStr, prompt, ts, osDetails, applyScriptSummary)+ s := "The current stage is: "+ if currentStage.TellStage == shared.TellStagePlanning {+ if currentStage.PlanningPhase == shared.PlanningPhaseContext {+ s += "CONTEXT"+ } else {+ s += "PLANNING"+ }+ } else if currentStage.TellStage == shared.TellStageImplementation {+ s += "IMPLEMENTATION"+ }+ s += "\n\n"+ s += fmt.Sprintf(promptWrapperFormatStr, prompt, ts, osDetails, applyScriptSummary)if currentStage.TellStage == shared.TellStageImplementation && params.UnfinishedSubtaskReasoning != "" {s += "\n\n" + `@@ -284,9 +295,11 @@ You MUST address these issues in the next response and ensure the task is fullyreturn s}-const UserContinuePrompt = "Continue the plan."+const UserContinuePrompt = "Continue the plan according to your instructions for the current stage. Don't repeat any part of your previous response."++const AutoContinuePlanningPrompt = UserContinuePrompt-const AutoContinuePrompt = `Continue the plan from where you left off in the previous response. Don't repeat any part of your previous response. Don't begin your response with 'Next,'.+const AutoContinueImplementationPrompt = `Continue the plan from where you left off in the previous response. Don't repeat any part of your previous response.Continue seamlessly from where your previous response left off.