Repository: Pythagora-io/gpt-pilot
File: pilot/helpers/agents/Developer.py (Python)

Code before:
                                         command_id=command_id,
                                         success_message=success_message,
                                         additional_message=additional_message,
                                         success_with_cli_response=success_with_cli_response)

    def step_human_intervention(self, convo, step: dict):
        """
        :param convo:
        :param step: {'human_intervention_description': 'some description'}
        :return: {
          'success': bool
          'user_input': string_from_human
        }
        """
        logger.info('Human intervention needed%s: %s',
                    '' if self.run_command is None else f' for command `{self.run_command}`',
                    step['human_intervention_description'])

        while True:
            human_intervention_description = step['human_intervention_description']

            if not self.run_command:
                self.get_run_command(convo)

            if self.run_command:
                if (self.project.ipc_client_instance is None or self.project.ipc_client_instance.client is None):
                    human_intervention_description += color_yellow_bold('\n\nIf you want to run the app, just type "r" and press ENTER and that will run `' + self.run_command + '`')
                else:
                    print(self.run_command, type='run_command')

            response = self.project.ask_for_human_intervention('I need human intervention:',
                human_intervention_description,
                cbs={
                    'r': lambda conv: run_command_until_success(conv,
                                                                self.run_command,
                                                                # name the process so the LLM can kill it
                                                                command_id='app',
                                                                # If the app doesn't crash in the first 1st second
                                                                # assume it's good and leave it running.
                                                                # If timeout is None the conversation can't continue
                                                                timeout=None,
                                                                force=True,
                                                                return_cli_response=True)
                },
                convo=convo)

            logger.info('human response: %s', response)
            if 'user_input' not in response:
                continue

            if response['user_input'] == 'continue':

Review comment (suggestion):
logic is same as before just instead of checking
`if not self.project.check_ipc():`
I swapped it around so that we are checking 
`if self.project.check_ipc():`

Code after:
                                         command_id=command_id,
                                         success_message=success_message,
                                         additional_message=additional_message,
                                         success_with_cli_response=success_with_cli_response)

    def step_human_intervention(self, convo, step: dict):
        """
        :param convo:
        :param step: {'human_intervention_description': 'some description'}
        :return: {
          'success': bool
          'user_input': string_from_human
        }
        """
        logger.info('Human intervention needed%s: %s',
                    '' if self.run_command is None else f' for command `{self.run_command}`',
                    step['human_intervention_description'])

        while True:
            human_intervention_description = step['human_intervention_description']

            if not self.run_command:
                self.get_run_command(convo)

            if self.run_command:
                if self.project.check_ipc():
                    print(self.run_command, type='run_command')
                else:
                    human_intervention_description += color_yellow_bold('\n\nIf you want to run the app, just type "r" and press ENTER and that will run `' + self.run_command + '`')

            response = self.project.ask_for_human_intervention('I need human intervention:',
                human_intervention_description,
                cbs={
                    'r': lambda conv: run_command_until_success(conv,
                                                                self.run_command,
                                                                # name the process so the LLM can kill it
                                                                command_id='app',
                                                                # If the app doesn't crash in the first 1st second
                                                                # assume it's good and leave it running.
                                                                # If timeout is None the conversation can't continue
                                                                timeout=None,
                                                                force=True,
                                                                return_cli_response=True)
                },
                convo=convo)

            logger.info('human response: %s', response)
            if 'user_input' not in response:
                continue

            if response['user_input'] == 'continue':