mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Detailed logs for ssh_box (#2173)
This commit is contained in:
parent
06e45afc75
commit
04d7354501
@ -422,7 +422,9 @@ class DockerSSHBox(Sandbox):
|
||||
prev_output: str = '',
|
||||
ignore_last_output: bool = False,
|
||||
) -> tuple[int, str]:
|
||||
logger.exception('Command timed out, killing process...', exc_info=False)
|
||||
logger.exception(
|
||||
f'Command "{cmd}" timed out, killing process...', exc_info=False
|
||||
)
|
||||
# send a SIGINT to the process
|
||||
self.ssh.sendintr()
|
||||
self.ssh.prompt()
|
||||
@ -431,7 +433,7 @@ class DockerSSHBox(Sandbox):
|
||||
command_output += '\n' + self.ssh.before
|
||||
return (
|
||||
-1,
|
||||
f'Command: "{cmd}" timed out. Sending SIGINT to the process: {command_output}',
|
||||
f'Command: "{cmd}" timed out. Sent SIGINT to the process: {command_output}',
|
||||
)
|
||||
|
||||
def execute(
|
||||
@ -455,7 +457,6 @@ class DockerSSHBox(Sandbox):
|
||||
return 0, SSHExecCancellableStream(self.ssh, cmd, self.timeout)
|
||||
success = self.ssh.prompt(timeout=timeout)
|
||||
if not success:
|
||||
logger.exception('Command timed out, killing process...', exc_info=False)
|
||||
return self._send_interrupt(cmd)
|
||||
command_output = self.ssh.before
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user