mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-10 13:37:55 -05:00
minor fixes for troubleshooter (#675)
This commit is contained in:
@@ -3,3 +3,4 @@ MAX_RECURSION_LAYER = 3
|
||||
MIN_COMMAND_RUN_TIME = 2000 # 2sec
|
||||
MAX_COMMAND_RUN_TIME = 60000 # 1min
|
||||
MAX_COMMAND_OUTPUT_LENGTH = 50000
|
||||
MAX_QUESTIONS_FOR_BUG_REPORT = 5
|
||||
|
||||
@@ -15,7 +15,7 @@ from utils.style import (
|
||||
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
|
||||
@@ -689,15 +689,16 @@ class Developer(Agent):
|
||||
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({
|
||||
@@ -705,6 +706,9 @@ class Developer(Agent):
|
||||
"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):
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user