From 099da97e7bcda365721d468a46ef2e7e2d969bf6 Mon Sep 17 00:00:00 2001 From: jnjpng Date: Fri, 14 Nov 2025 17:15:01 -0800 Subject: [PATCH] fix: remove modal image creation logging and fix base imports (#6197) base Co-authored-by: Letta Bot --- letta/constants.py | 2 +- letta/services/tool_manager.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/letta/constants.py b/letta/constants.py index 330edff3..392bba54 100644 --- a/letta/constants.py +++ b/letta/constants.py @@ -457,6 +457,6 @@ MODAL_DEFAULT_MAX_CONCURRENT_INPUTS = 1 MODAL_DEFAULT_PYTHON_VERSION = "3.12" # Security settings -MODAL_SAFE_IMPORT_MODULES = {"typing", "pydantic", "datetime", "enum", "uuid", "decimal"} +MODAL_SAFE_IMPORT_MODULES = {"typing", "pydantic", "datetime", "uuid"} # decimal, enum # Default handle for model used to generate tools DEFAULT_GENERATE_TOOL_MODEL_HANDLE = "openai/gpt-4.1" diff --git a/letta/services/tool_manager.py b/letta/services/tool_manager.py index d7aabddd..245f8ea7 100644 --- a/letta/services/tool_manager.py +++ b/letta/services/tool_manager.py @@ -20,6 +20,7 @@ from letta.constants import ( MCP_TOOL_TAG_NAME_PREFIX, MODAL_DEFAULT_PYTHON_VERSION, MODAL_DEFAULT_TOOL_NAME, + MODAL_SAFE_IMPORT_MODULES, ) from letta.errors import LettaInvalidArgumentError, LettaToolNameConflictError, LettaToolNameSchemaMismatchError from letta.functions.functions import derive_openai_json_schema, load_function_set @@ -58,6 +59,8 @@ def modal_tool_wrapper(tool: PydanticTool, actor: PydanticUser, sandbox_env_vars from letta_client import Letta packages = [str(req) for req in tool.pip_requirements] if tool.pip_requirements else [] + for package in MODAL_SAFE_IMPORT_MODULES: + packages.append(package) packages.append("letta_client") packages.append("letta") # Base letta without extras packages.append("asyncpg>=0.30.0") # Fixes asyncpg import error @@ -1026,7 +1029,7 @@ class ToolManager: modal_app = modal_tool_wrapper(tool, actor, sandbox_env_vars) # Deploy the app first - with modal.enable_output(): + with modal.enable_output(show_progress=False): try: deploy = modal_app.deploy() except Exception as e: