From 5e120acfeb60d209c9bfd47e5cfc28b40a1bb572 Mon Sep 17 00:00:00 2001 From: Matt Zhou Date: Fri, 15 Nov 2024 14:36:29 -0800 Subject: [PATCH] Try again --- letta/services/tool_execution_sandbox.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/letta/services/tool_execution_sandbox.py b/letta/services/tool_execution_sandbox.py index fd3fe3afd5..898456d4ac 100644 --- a/letta/services/tool_execution_sandbox.py +++ b/letta/services/tool_execution_sandbox.py @@ -111,6 +111,9 @@ def run_e2b_sandbox(self, code: str) -> Optional[Any]: if not sbx or self.force_recreate: sbx = self.create_e2b_sandbox_with_metadata_hash(sandbox_config=sbx_config) + # Since this sandbox was used, we extend its lifecycle by the timeout + sbx.set_timeout(sbx_config.get_e2b_config().timeout) + # Get environment variables for the sandbox # TODO: We set limit to 100 here, but maybe we want it uncapped? Realistically this should be fine. env_vars = self.sandbox_config_manager.get_sandbox_env_vars_as_dict(sandbox_config_id=sbx_config.id, actor=self.user, limit=100)