Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: remove modal image creation logging and fix base imports (#6197)

jnjpng099da97e7bcd
diff --git a/letta/constants.py b/letta/constants.py
index 330edff30..392bba548 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 d7aabdddd..245f8ea77 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: