multiple small fixes

This commit is contained in:
LeonOstrez
2024-03-04 23:46:28 -08:00
parent 85cbb43096
commit 6cccbf2c47
4 changed files with 14 additions and 3 deletions

View File

@@ -102,6 +102,7 @@ class Project:
self.tasks_to_load = []
self.features_to_load = []
self.dev_steps_to_load = []
self.run_command = None
# end loading of project
def set_root_path(self, root_path: str):
@@ -172,6 +173,9 @@ class Project:
self.checkpoints['last_development_step'] = self.dev_steps_to_load[-1]
self.tasks_to_load = [el for el in self.dev_steps_to_load if 'breakdown.prompt' in el.get('prompt_path', '')]
self.features_to_load = [el for el in self.dev_steps_to_load if 'feature_plan.prompt' in el.get('prompt_path', '')]
self.run_command = next((el for el in reversed(self.dev_steps_to_load) if 'get_run_command.prompt' in el.get('prompt_path', '')), None)
if self.run_command is not None:
self.run_command = json.loads(self.run_command['llm_response']['text'])['command']
def start(self):
"""
@@ -233,11 +237,13 @@ class Project:
self.previous_features = get_features_by_app_id(self.args['app_id'])
if not self.skip_steps:
print('', type='verbose', category='pythagora')
if self.run_command and self.check_ipc():
print(self.run_command, type='run_command')
feature_description = ask_user(self, "Project is finished! Do you want to add any features or changes? "
"If yes, describe it here and if no, just press ENTER",
require_some_input=False)
if feature_description == '':
if feature_description == '' or feature_description == 'continue':
return
print('', type='verbose', category='agent:tech-lead')
@@ -415,7 +421,7 @@ class Project:
print('continue', type='buttons-only')
user_input = ask_user(
self,
f'Please open the file {data["path"]} on the line {line_number} and add the required input. Once you\'re done, type "y" to continue.',
f'Please open the file {data["path"]} on the line {line_number} and add the required input. Please, also remove "// INPUT_REQUIRED" comment and once you\'re done, press "continue".',
require_some_input=False,
ignore_user_input_count=True
)

View File

@@ -262,7 +262,7 @@ class CodeMonkey(Agent):
else:
# The reviewer failed to review all the hunks in 3 attempts, let's just use all the new content
convo.remove_last_x_messages(messages_to_remove)
return new_content
return new_content, None
convo.remove_last_x_messages(messages_to_remove)

View File

@@ -391,6 +391,8 @@ class Developer(Agent):
elif single_match:
self.run_command = single_match.group(1).strip()
self.project.run_command = self.run_command
def task_postprocessing(self, convo, development_task, continue_development, task_result, last_branch_name):
if self.project.last_detailed_user_review_goal is None:
self.get_run_command(convo)

View File

@@ -101,6 +101,7 @@ if __name__ == "__main__":
started = project.start()
if started:
project.finish()
print('Thank you for using Pythagora!', type='ipc', category='pythagora')
telemetry.set("end_result", "success:exit")
else:
run_exit_fn = False
@@ -143,6 +144,8 @@ if __name__ == "__main__":
finally:
if project is not None:
if project.check_ipc():
ask_feedback = False
project.current_task.exit()
project.finish_loading(do_cleanup=False)
if run_exit_fn: