|
15 | 15 | color_white_bold
|
16 | 16 | )
|
17 | 17 | from helpers.exceptions import TokenLimitError
|
18 |
| -from const.code_execution import MAX_COMMAND_DEBUG_TRIES |
| 18 | +from const.code_execution import MAX_COMMAND_DEBUG_TRIES, MAX_QUESTIONS_FOR_BUG_REPORT |
19 | 19 | from helpers.exceptions import TooDeepRecursionError
|
20 | 20 | from helpers.Debugger import Debugger
|
21 | 21 | from utils.questionary import styled_text
|
@@ -689,22 +689,26 @@ def bug_report_generator(self, user_feedback):
|
689 | 689 | if len(missing_data) == 0:
|
690 | 690 | break
|
691 | 691 |
|
| 692 | + length_before = len(questions_and_answers) |
692 | 693 | for missing_data_item in missing_data:
|
693 | 694 | if self.project.check_ipc():
|
694 | 695 | print(missing_data_item['question'], type='verbose')
|
695 |
| - print('skip question', type='button') |
| 696 | + print('continue/skip question', type='button') |
696 | 697 | if self.run_command:
|
697 | 698 | print(self.run_command, type='run_command')
|
698 | 699 |
|
699 |
| - answer = ask_user(self.project, missing_data_item['question']) |
700 |
| - if answer.lower() == 'skip question': |
| 700 | + answer = ask_user(self.project, missing_data_item['question'], require_some_input=False) |
| 701 | + if answer.lower() == 'skip question' or answer.lower() == '' or answer.lower() == 'continue': |
701 | 702 | continue
|
702 | 703 |
|
703 | 704 | questions_and_answers.append({
|
704 | 705 | "question": missing_data_item['question'],
|
705 | 706 | "answer": answer
|
706 | 707 | })
|
707 | 708 |
|
| 709 | + # if user skips all questions or if we got more than 4 answers, we don't want to get stuck in infinite loop |
| 710 | + if length_before == len(questions_and_answers) or len(questions_and_answers) >= MAX_QUESTIONS_FOR_BUG_REPORT: |
| 711 | + break |
708 | 712 | bug_report_convo.load_branch(function_uuid)
|
709 | 713 |
|
710 | 714 | if len(questions_and_answers):
|
|
0 commit comments