Clean shutdown of system components.
(self)
| 111 | raise |
| 112 | |
| 113 | async def shutdown(self) -> None: |
| 114 | """Clean shutdown of system components.""" |
| 115 | try: |
| 116 | # Cleanup MCP connections if initialized |
| 117 | await cleanup_mcp() |
| 118 | |
| 119 | if hasattr(self.memory_manager, 'shutdown'): |
| 120 | await self.memory_manager.shutdown() |
| 121 | self.system_ready = False |
| 122 | logger.info("InternAgent system shut down successfully") |
| 123 | except Exception as e: |
| 124 | logger.error(f"Error during system shutdown: {str(e)}") |
| 125 | raise |
| 126 | |
| 127 | async def create_session(self, |
| 128 | goal_description: str, |
no test coverage detected