diff --git a/pilot/helpers/agents/Developer.py b/pilot/helpers/agents/Developer.py index 038b92af8f..cff4a228b8 100644 --- a/pilot/helpers/agents/Developer.py +++ b/pilot/helpers/agents/Developer.py @@ -237,6 +237,7 @@ class Developer(Agent): "delete-file-stub", data, ) + return {"success": True} def step_save_file(self, convo, step, i, test_after_code_changes): @@ -465,7 +466,9 @@ class Developer(Agent): convo.save_branch(function_uuid) for (i, step) in enumerate(task_steps): - if step['type'] in ['save_file', 'code_change', 'modify_file'] and 'path' in step[step['type']]: + if (step['type'] in ['save_file', 'code_change', 'modify_file'] and + 'path' in step[step['type']] and + step[step['type']]['path'] not in self.modified_files): self.modified_files.append(step[step['type']]['path']) # This means we are still loading the project and have all the steps until last iteration if self.project.last_iteration is not None or self.project.last_detailed_user_review_goal is not None: @@ -708,7 +711,6 @@ class Developer(Agent): 'implementation_needed': False, } - review_convo.remove_last_x_messages(2) llm_response = review_convo.send_message('development/parse_task.prompt', { 'os': platform.system(), 'instructions_prefix': instructions_prefix, diff --git a/pilot/prompts/development/parse_task.prompt b/pilot/prompts/development/parse_task.prompt index 3e50be7476..e3c0ea543a 100644 --- a/pilot/prompts/development/parse_task.prompt +++ b/pilot/prompts/development/parse_task.prompt @@ -15,7 +15,7 @@ Each step can be either: {{ logs_and_error_handling }} -**IMPORTANT**: Remember, NEVER output human intervention steps to do manual tests or coding tasks, even if the previous message asks for it! The testing will be done *after* these steps and you MUTS NOT include testing in these steps. +**IMPORTANT**: Remember, NEVER output human intervention steps to do manual tests or coding tasks, even if the previous message asks for it! The testing will be done *after* these steps and you MUST NOT include testing in these steps. Examples: ------------------------example_1--------------------------- diff --git a/pilot/prompts/development/review_task.prompt b/pilot/prompts/development/review_task.prompt index 31f06fdc34..4eddca6086 100644 --- a/pilot/prompts/development/review_task.prompt +++ b/pilot/prompts/development/review_task.prompt @@ -6,16 +6,23 @@ Here is a high level description of "{{ name }}": ``` Development process of this app was split into smaller tasks. Here is the list of all tasks: -``` -{{ tasks }} +```{% for task in tasks %} +{{ loop.index }}. {{ task['description'] }} +{% endfor %} ``` You are currently working on task "{{ current_task }}" and you have to focus only on that task. A part of the app is already finished. Here are files that were modified during this task implementation: ----START_OF_FILES--- -{{ files_list }} ----END_OF_FILES--- +{% if files|length > 0 %}---start_of_current_files--- +{% for file in files %} +**{{ file.path }}/{{ file.name }}** ({{ file.lines_of_code }} lines of code): +``` +{{ file.content }} +``` +{% endfor %} +---end_of_current_files--- +{% endif -%} {% if user_input -%}While working on this task, your colleague who is testing the app "{{ name }}" sent you some additional info. Here it is: ``` @@ -29,9 +36,15 @@ After this info, you tried to fix it. {% endif %}Files that were modified during Now I will show you how those files looked before this task implementation started. If a file is listed as the file that changed but is not in this list that means it was created during this task. Here are files before implementation of this task: ----start_of_files_at_start_of_task--- -{{ files_at_start_of_task }} +{% if files_at_start_of_task|length > 0 %}---start_of_files_at_start_of_task--- +{% for file in files_at_start_of_task %} +**{{ file.path }}/{{ file.name }}** ({{ file.lines_of_code }} lines of code): +``` +{{ file.content }} +``` +{% endfor %} ---end_of_files_at_start_of_task--- +{% endif -%} **IMPORTANT** You have to review this task implementation. You are known to be very strict with your reviews and very good at noticing bugs but you don't mind minor changes like refactoring, adding or removing logs and so on. You think twice through all information given before giving any conclusions. @@ -45,3 +58,7 @@ Your goal is to check: If everything is ok respond only with "DONE" and nothing else. Do NOT respond with thoughts, reasoning, explanations or anything similar if everything is ok, respond just with "DONE". If you find any of these 3 mistakes describe shortly what has to be changed. + +{{ execution_order }} + +{{ human_intervention_explanation }}