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(core): raise 404 properly for agent not found (#5118)

Charles Packer62a5d1009909
diff --git a/letta/services/agent_manager.py b/letta/services/agent_manager.py
index 81f283a5e..2e98dbec6 100644
--- a/letta/services/agent_manager.py
+++ b/letta/services/agent_manager.py
@@ -937,6 +937,9 @@ class AgentManager:
raise NoResultFound(f"Agent with ID {agent_id} not found")
return await agent.to_pydantic_async(include_relationships=include_relationships)
+ except NoResultFound:
+ # Re-raise NoResultFound without logging to preserve 404 handling
+ raise
except Exception as e:
logger.error(f"Error fetching agent {agent_id}: {str(e)}")
raise