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

base

Co-authored-by: Letta Bot <noreply@letta.com>
This commit is contained in:
jnjpng
2025-11-14 17:15:01 -08:00
committed by Caren Thomas
parent a5e435c56f
commit 099da97e7b
2 changed files with 5 additions and 2 deletions

View File

@@ -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"

View File

@@ -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: