diff --git a/pilot/helpers/Project.py b/pilot/helpers/Project.py index 53a260e8c..f67fb9260 100644 --- a/pilot/helpers/Project.py +++ b/pilot/helpers/Project.py @@ -102,6 +102,7 @@ def __init__( 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 @@ def setup_loading(self): 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 @@ def finish(self): 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 @@ def save_file(self, data): 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 ) diff --git a/pilot/helpers/agents/CodeMonkey.py b/pilot/helpers/agents/CodeMonkey.py index e20c7d17d..4ca789284 100644 --- a/pilot/helpers/agents/CodeMonkey.py +++ b/pilot/helpers/agents/CodeMonkey.py @@ -262,7 +262,7 @@ def review_change( 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) diff --git a/pilot/helpers/agents/Developer.py b/pilot/helpers/agents/Developer.py index 3b7fbb56f..59699b047 100644 --- a/pilot/helpers/agents/Developer.py +++ b/pilot/helpers/agents/Developer.py @@ -391,6 +391,8 @@ def get_run_command(self, convo): 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) diff --git a/pilot/main.py b/pilot/main.py index 9179c2cc1..81492cced 100644 --- a/pilot/main.py +++ b/pilot/main.py @@ -101,6 +101,7 @@ def init(): 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 @@ def init(): 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: