Parse sandbox execution results into stdout, stderr, exit_code.
(self,
results: Dict[str, Any])
| 831 | return '\n'.join(lines) |
| 832 | |
| 833 | def _parse_sandbox_result(self, |
| 834 | results: Dict[str, Any]) -> tuple[str, str, int]: |
| 835 | """Parse sandbox execution results into stdout, stderr, exit_code.""" |
| 836 | stdout_parts = [] |
| 837 | stderr_parts = [] |
| 838 | exit_code = 0 |
| 839 | |
| 840 | for executor_type in ['python_executor', 'shell_executor']: |
| 841 | if executor_type in results: |
| 842 | for result in results[executor_type]: |
| 843 | if result.get('output'): |
| 844 | stdout_parts.append(result['output']) |
| 845 | if result.get('error'): |
| 846 | stderr_parts.append(result['error']) |
| 847 | if result.get('status', 0) != 0: |
| 848 | exit_code = result.get('status', -1) |
| 849 | |
| 850 | return '\n'.join(stdout_parts), '\n'.join(stderr_parts), exit_code |
| 851 | |
| 852 | async def _execute_in_sandbox( |
| 853 | self, |
no test coverage detected