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

minor fixes for troubleshooter #675

Merged
merged 2 commits into from
Feb 22, 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
1 change: 1 addition & 0 deletions pilot/const/code_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
MIN_COMMAND_RUN_TIME = 2000 # 2sec
MAX_COMMAND_RUN_TIME = 60000 # 1min
MAX_COMMAND_OUTPUT_LENGTH = 50000
MAX_QUESTIONS_FOR_BUG_REPORT = 5
12 changes: 8 additions & 4 deletions pilot/helpers/agents/Developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
color_white_bold
)
from helpers.exceptions import TokenLimitError
from const.code_execution import MAX_COMMAND_DEBUG_TRIES
from const.code_execution import MAX_COMMAND_DEBUG_TRIES, MAX_QUESTIONS_FOR_BUG_REPORT
from helpers.exceptions import TooDeepRecursionError
from helpers.Debugger import Debugger
from utils.questionary import styled_text
Expand Down Expand Up @@ -689,22 +689,26 @@ def bug_report_generator(self, user_feedback):
if len(missing_data) == 0:
break

length_before = len(questions_and_answers)
for missing_data_item in missing_data:
if self.project.check_ipc():
print(missing_data_item['question'], type='verbose')
print('skip question', type='button')
print('continue/skip question', type='button')
if self.run_command:
print(self.run_command, type='run_command')

answer = ask_user(self.project, missing_data_item['question'])
if answer.lower() == 'skip question':
answer = ask_user(self.project, missing_data_item['question'], require_some_input=False)
if answer.lower() == 'skip question' or answer.lower() == '' or answer.lower() == 'continue':
continue

questions_and_answers.append({
"question": missing_data_item['question'],
"answer": answer
})

# if user skips all questions or if we got more than 4 answers, we don't want to get stuck in infinite loop
if length_before == len(questions_and_answers) or len(questions_and_answers) >= MAX_QUESTIONS_FOR_BUG_REPORT:
break
bug_report_convo.load_branch(function_uuid)

if len(questions_and_answers):
Expand Down
1 change: 1 addition & 0 deletions pilot/prompts/development/bug_report.prompt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ If you have enough information don't ask any questions.
When thinking of questions, consider the following:
- After getting answers to your questions, you must be able to solve the problem.
- Category on which you need more information ("general", "frontend", "backend", "database", "devops", "other")
- Client is not very technical person but understands basics. It is crucial that your questions can be answered without looking into code or knowing codebase. Do not ask how something is implemented, how code works or for code snippets.
- Make sure to cover all categories that you need to solve the problem.
- Ask only specific information that you need to solve the problem.
- Ask clear, short and concise questions.
Expand Down
1 change: 1 addition & 0 deletions pilot/prompts/development/bug_report_summary.prompt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ Your job is now to write issue explanation that will be sent to developer, stric
- Write issue explanation as if you are talking directly to developer (in first person). Do not mention "user", talk as if you found the the issue.
- Do not use any subjective thoughts, just facts.
- Write only issue explanation. Do not write any recap, summary or ideas how to solve the problem at the end. Do not write introduction at the start (e.g. "Issue Explanation for Developer:").
- Do not write any new code, only if something is provided by user.
- Have in mind that developer is smart and he will understand everything as long as you provide all information that you have and that is needed to fix this issue.
- Have in mind that issue might not be related to your current development task.