MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / pause

Method pause

server/services/process_manager.py:443–464  ·  view source on GitHub ↗

Pause the agent using psutil for cross-platform support. Returns: Tuple of (success, message)

(self)

Source from the content-addressed store, hash-verified

441 return False, f"Failed to stop agent: {e}"
442
443 async def pause(self) -> tuple[bool, str]:
444 """
445 Pause the agent using psutil for cross-platform support.
446
447 Returns:
448 Tuple of (success, message)
449 """
450 if not self.process or self.status != "running":
451 return False, "Agent is not running"
452
453 try:
454 proc = psutil.Process(self.process.pid)
455 proc.suspend()
456 self.status = "paused"
457 return True, "Agent paused"
458 except psutil.NoSuchProcess:
459 self.status = "crashed"
460 self._remove_lock()
461 return False, "Agent process no longer exists"
462 except Exception as e:
463 logger.exception("Failed to pause agent")
464 return False, f"Failed to pause agent: {e}"
465
466 async def resume(self) -> tuple[bool, str]:
467 """

Callers 1

pause_agentFunction · 0.80

Calls 1

_remove_lockMethod · 0.95

Tested by

no test coverage detected