From fb691ac4b79a482ec3e7809a57ee7d53db5cdc88 Mon Sep 17 00:00:00 2001 From: Matthew Zhou Date: Tue, 28 Jan 2025 15:19:14 -1000 Subject: [PATCH] feat: Restore local sandbox execution (#822) --- letta/server/server.py | 2 +- letta/services/tool_execution_sandbox.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/letta/server/server.py b/letta/server/server.py index 35c2e16c..4ff2bccf 100644 --- a/letta/server/server.py +++ b/letta/server/server.py @@ -207,7 +207,7 @@ if settings.letta_pg_uri_no_default: else: # TODO: don't rely on config storage engine_path = "sqlite:///" + os.path.join(config.recall_storage_path, "sqlite.db") - print("Creating sqlite engine", engine_path) + logger.info("Creating sqlite engine " + engine_path) engine = create_engine(engine_path) diff --git a/letta/services/tool_execution_sandbox.py b/letta/services/tool_execution_sandbox.py index d15b63c9..5016ce1b 100644 --- a/letta/services/tool_execution_sandbox.py +++ b/letta/services/tool_execution_sandbox.py @@ -225,7 +225,8 @@ class ToolExecutionSandbox: try: # Execute the temp file - result = runpy.run_path(temp_file_path, init_globals=env) + with self.temporary_env_vars(env): + result = runpy.run_path(temp_file_path, init_globals=env) # Fetch the result func_result = result.get(self.LOCAL_SANDBOX_RESULT_VAR_NAME)