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: Fix `create_job_async` (#4868)

Matthew Zhou16d666a43489
diff --git a/letta/services/job_manager.py b/letta/services/job_manager.py
index c909d02df..9b4e81a89 100644
--- a/letta/services/job_manager.py
+++ b/letta/services/job_manager.py
@@ -84,7 +84,8 @@ class JobManager:
agent_id = getattr(pydantic_job, "agent_id", None)
# Verify agent exists before creating the job
- await validate_agent_exists_async(session, agent_id, actor)
+ if agent_id:
+ await validate_agent_exists_async(session, agent_id, actor)
job_data = pydantic_job.model_dump(to_orm=True)
# Remove agent_id from job_data as it's not a field in the Job ORM model