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: make auto-mode work e2e (#9771)

cthomasccea05feb198
diff --git a/letta/agents/letta_agent_v3.py b/letta/agents/letta_agent_v3.py
index baa159275..c92f452ae 100644
--- a/letta/agents/letta_agent_v3.py
+++ b/letta/agents/letta_agent_v3.py
@@ -959,6 +959,9 @@ class LettaAgentV3(LettaAgentV2):
put_inner_thoughts_first=True,
actor=self.actor,
)
+ # Update the adapter to use the resolved client and config
+ llm_adapter.llm_client = active_llm_client
+ llm_adapter.llm_config = active_llm_config
else:
active_llm_config = self.agent_state.llm_config
active_llm_client = self.llm_client
diff --git a/letta/server/server.py b/letta/server/server.py
index 23e2bf62e..f769f40bd 100644
--- a/letta/server/server.py
+++ b/letta/server/server.py
@@ -1254,6 +1254,7 @@ class SyncServer(object):
context_window=model.max_context_window or 180000,
handle=model.handle,
provider_name="letta",
+ provider_category=ProviderCategory.base,
max_tokens=8192,
)
llm_models.append(llm_config)
diff --git a/letta/services/provider_manager.py b/letta/services/provider_manager.py
index 2c8359488..5c245bc8a 100644
--- a/letta/services/provider_manager.py
+++ b/letta/services/provider_manager.py
@@ -937,7 +937,7 @@ class ProviderManager:
from letta.settings import model_settings
- if model_settings.auto_mode_enabled and (model_type is None or model_type == "llm"):
+ if model_settings.auto_mode_enabled and not provider_id and (model_type is None or model_type == "llm"):
for handle in AUTO_MODE_HANDLES:
# Generate deterministic 8-char hex ID from handle
handle_hash = hashlib.sha256(handle.encode()).hexdigest()[:8]