Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple small fixes #702

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pilot/helpers/Project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can there ever be a "continue" button here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why but when there is run_command extension shows Continue button 🤷‍♂️ I guess they come in pair...

return

print('', type='verbose', category='agent:tech-lead')
Expand Down Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion pilot/helpers/agents/CodeMonkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions pilot/helpers/agents/Developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions pilot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading