diff --git a/pilot/helpers/Project.py b/pilot/helpers/Project.py index c55a6aa..6eddb5e 100644 --- a/pilot/helpers/Project.py +++ b/pilot/helpers/Project.py @@ -70,6 +70,9 @@ class Project: clear_directory(self.root_path) delete_all_app_development_data(self.args['app_id']) self.skip_steps = False + elif 'update_files_before_start' in self.args and self.skip_until_dev_step is not None: + FileSnapshot.delete().where(FileSnapshot.app == self.app and FileSnapshot.development_step == self.skip_until_dev_step).execute() + self.save_files_snapshot(self.skip_until_dev_step) # TODO END self.developer = Developer(self) diff --git a/pilot/helpers/agents/CodeMonkey.py b/pilot/helpers/agents/CodeMonkey.py index 9442778..ae83c80 100644 --- a/pilot/helpers/agents/CodeMonkey.py +++ b/pilot/helpers/agents/CodeMonkey.py @@ -29,7 +29,8 @@ class CodeMonkey(Agent): }, IMPLEMENT_CHANGES) convo.remove_last_x_messages(1) - for file_data in changes: - self.project.save_file(file_data) + if (not self.project.args['update_files_before_start']) or (self.project.skip_until_dev_step != str(self.project.checkpoints['last_development_step'].id)): + for file_data in changes: + self.project.save_file(file_data) return convo diff --git a/pilot/helpers/agents/Developer.py b/pilot/helpers/agents/Developer.py index 3afe0a1..06ee8ba 100644 --- a/pilot/helpers/agents/Developer.py +++ b/pilot/helpers/agents/Developer.py @@ -107,12 +107,17 @@ class Developer(Agent): return True self.run_command = convo.send_message('development/get_run_command.prompt', {}) + if self.run_command.startswith('`'): + self.run_command = self.run_command[1:] + if self.run_command.endswith('`'): + self.run_command = self.run_command[:-1] if continue_development: self.continue_development(convo) def continue_development(self, iteration_convo): while True: + # TODO add description about how can the user check if the app works user_feedback = self.project.ask_for_human_intervention( 'Can you check if the app works?\nIf you want to run the app, ' + colored('just type "r" and press ENTER', 'yellow', attrs=['bold']), cbs={ 'r': lambda: run_command_until_success(self.run_command, None, iteration_convo, force=True) })