Skip to content

Commit 3612d5a

Browse files
authored
Merge pull request #702 from Pythagora-io/small-fixes
multiple small fixes
2 parents 85cbb43 + 6cccbf2 commit 3612d5a

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

pilot/helpers/Project.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def __init__(
102102
self.tasks_to_load = []
103103
self.features_to_load = []
104104
self.dev_steps_to_load = []
105+
self.run_command = None
105106
# end loading of project
106107

107108
def set_root_path(self, root_path: str):
@@ -172,6 +173,9 @@ def setup_loading(self):
172173
self.checkpoints['last_development_step'] = self.dev_steps_to_load[-1]
173174
self.tasks_to_load = [el for el in self.dev_steps_to_load if 'breakdown.prompt' in el.get('prompt_path', '')]
174175
self.features_to_load = [el for el in self.dev_steps_to_load if 'feature_plan.prompt' in el.get('prompt_path', '')]
176+
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)
177+
if self.run_command is not None:
178+
self.run_command = json.loads(self.run_command['llm_response']['text'])['command']
175179

176180
def start(self):
177181
"""
@@ -233,11 +237,13 @@ def finish(self):
233237
self.previous_features = get_features_by_app_id(self.args['app_id'])
234238
if not self.skip_steps:
235239
print('', type='verbose', category='pythagora')
240+
if self.run_command and self.check_ipc():
241+
print(self.run_command, type='run_command')
236242
feature_description = ask_user(self, "Project is finished! Do you want to add any features or changes? "
237243
"If yes, describe it here and if no, just press ENTER",
238244
require_some_input=False)
239245

240-
if feature_description == '':
246+
if feature_description == '' or feature_description == 'continue':
241247
return
242248

243249
print('', type='verbose', category='agent:tech-lead')
@@ -415,7 +421,7 @@ def save_file(self, data):
415421
print('continue', type='buttons-only')
416422
user_input = ask_user(
417423
self,
418-
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.',
424+
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".',
419425
require_some_input=False,
420426
ignore_user_input_count=True
421427
)

pilot/helpers/agents/CodeMonkey.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def review_change(
262262
else:
263263
# The reviewer failed to review all the hunks in 3 attempts, let's just use all the new content
264264
convo.remove_last_x_messages(messages_to_remove)
265-
return new_content
265+
return new_content, None
266266

267267
convo.remove_last_x_messages(messages_to_remove)
268268

pilot/helpers/agents/Developer.py

+2
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ def get_run_command(self, convo):
391391
elif single_match:
392392
self.run_command = single_match.group(1).strip()
393393

394+
self.project.run_command = self.run_command
395+
394396
def task_postprocessing(self, convo, development_task, continue_development, task_result, last_branch_name):
395397
if self.project.last_detailed_user_review_goal is None:
396398
self.get_run_command(convo)

pilot/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def init():
101101
started = project.start()
102102
if started:
103103
project.finish()
104+
print('Thank you for using Pythagora!', type='ipc', category='pythagora')
104105
telemetry.set("end_result", "success:exit")
105106
else:
106107
run_exit_fn = False
@@ -143,6 +144,8 @@ def init():
143144

144145
finally:
145146
if project is not None:
147+
if project.check_ipc():
148+
ask_feedback = False
146149
project.current_task.exit()
147150
project.finish_loading(do_cleanup=False)
148151
if run_exit_fn:

0 commit comments

Comments
 (0)