Skip to content

Commit

Permalink
Merge pull request Pythagora-io#264 from Pythagora-io/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
nalbion authored Oct 21, 2023
2 parents efaa616 + 0665b28 commit 59c4d89
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pilot/helpers/AgentConvo.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def replace_files(self):
def replace_file_content(self, message, file_path, new_content):
escaped_file_path = re.escape(file_path)

# Escape any \U in the file path
escaped_file_path = escaped_file_path.replace("\\U", "\\\\U")
# Double escape backslashes in new_content
new_content = new_content.replace("\\", "\\\\")

pattern = rf'\*\*{{ {escaped_file_path} }}\*\*\n```\n(.*?)\n```'

Expand Down
6 changes: 4 additions & 2 deletions pilot/helpers/agents/Developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def task_postprocessing(self, convo, development_task, continue_development, tas
try:
if continue_development:
continue_description = detailed_user_review_goal if detailed_user_review_goal is not None else None
return self.continue_development(convo, last_branch_name, continue_description)
return self.continue_development(convo, last_branch_name, continue_description, development_task)
except TooDeepRecursionError as e:
logger.warning('Too deep recursion error. Call dev_help_needed() for human_intervention: %s', e.message)
return self.dev_help_needed({"type": "human_intervention", "human_intervention_description": e.message})
Expand Down Expand Up @@ -383,7 +383,7 @@ def execute_task(self, convo, task_steps, test_command=None, reset_convo=True,
convo.load_branch(function_uuid)
return self.task_postprocessing(convo, development_task, continue_development, result, function_uuid)

def continue_development(self, iteration_convo, last_branch_name, continue_description=''):
def continue_development(self, iteration_convo, last_branch_name, continue_description='', development_task=None):
while True:
logger.info('Continue development, last_branch_name: %s', last_branch_name)
iteration_convo.load_branch(last_branch_name)
Expand Down Expand Up @@ -429,6 +429,8 @@ def continue_development(self, iteration_convo, last_branch_name, continue_descr
"technologies": self.project.architecture,
"array_of_objects_to_string": array_of_objects_to_string, # TODO check why is this here
"directory_tree": self.project.get_directory_tree(True),
"current_task": development_task,
"development_tasks": self.project.development_plan,
"files": self.project.get_all_coded_files(),
"user_input": user_feedback,
})
Expand Down
13 changes: 11 additions & 2 deletions pilot/prompts/development/iteration.prompt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ Here are the technologies that you need to use for this project:
- {{ tech }}{% endfor %}
```

A big part of the app is already finished. Here are files that are currently implemented:
{% if development_tasks and current_task %}
Development process of this app was split into smaller tasks. Here is the list of all tasks:
```{% for task in development_tasks %}
- {{ loop.index }}. {{ task['description'] }}
{% endfor %}
```
You are currently working on task "{{ current_task.description }}" and you have to focus only on that task.

{% endif %}
A part of the app is already finished.Here are files that are currently implemented:
{% for file in files %}
**{{ file.path }}**:
```
Expand All @@ -25,7 +34,7 @@ Now, your colleague who is testing the app "{{ name }}" sent you some additional

Can you debug this issue or implement changes to comply with the additional user input?

Tell me all the new code that needs to be written or modified to implement this app and have it fully working. You can count that the environment is set up previously and packages listed in files are installed so tell me only commands needed for installation of new dependencies.
Tell me all the new code that needs to be written or modified to implement current task and have it fully working. You can count that the environment is set up previously and packages listed in files are installed so tell me only commands needed for installation of new dependencies, if there are any.

{# Do not leave any parts of the code to be written afterwards. Make sure that all the code you provide is working and does as outlined in the description area above.
#}
Expand Down

0 comments on commit 59c4d89

Please sign in to comment.