Resume a paused agent. Returns: Tuple of (success, message)
(self)
| 464 | return False, f"Failed to pause agent: {e}" |
| 465 | |
| 466 | async def resume(self) -> tuple[bool, str]: |
| 467 | """ |
| 468 | Resume a paused agent. |
| 469 | |
| 470 | Returns: |
| 471 | Tuple of (success, message) |
| 472 | """ |
| 473 | if not self.process or self.status != "paused": |
| 474 | return False, "Agent is not paused" |
| 475 | |
| 476 | try: |
| 477 | proc = psutil.Process(self.process.pid) |
| 478 | proc.resume() |
| 479 | self.status = "running" |
| 480 | return True, "Agent resumed" |
| 481 | except psutil.NoSuchProcess: |
| 482 | self.status = "crashed" |
| 483 | self._remove_lock() |
| 484 | return False, "Agent process no longer exists" |
| 485 | except Exception as e: |
| 486 | logger.exception("Failed to resume agent") |
| 487 | return False, f"Failed to resume agent: {e}" |
| 488 | |
| 489 | async def healthcheck(self) -> bool: |
| 490 | """ |
no test coverage detected