From c3c38f2713c611121d162033b8beb6bffb0eb0d4 Mon Sep 17 00:00:00 2001 From: cthomas Date: Wed, 22 Oct 2025 16:00:55 -0700 Subject: [PATCH] feat: rename multi agent group to managed group [LET-5799] (#5672) feat: rename multi agent group to managed group --- fern/openapi.json | 12 ++++++++++++ letta/orm/agent.py | 3 +++ letta/schemas/agent.py | 4 ++-- tests/managers/test_agent_manager.py | 7 ++++--- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/fern/openapi.json b/fern/openapi.json index 2c45007f..bac63d10 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -16721,6 +16721,18 @@ "description": "If set to True, memory management will move to a background agent thread." }, "multi_agent_group": { + "anyOf": [ + { + "$ref": "#/components/schemas/Group" + }, + { + "type": "null" + } + ], + "description": "The multi-agent group that this agent manages", + "deprecated": true + }, + "managed_group": { "anyOf": [ { "$ref": "#/components/schemas/Group" diff --git a/letta/orm/agent.py b/letta/orm/agent.py index e7a0cac7..cc269bbc 100644 --- a/letta/orm/agent.py +++ b/letta/orm/agent.py @@ -268,6 +268,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin "identity_ids": lambda: [i.id for i in self.identities], "identities": lambda: [i.to_pydantic() for i in self.identities], "multi_agent_group": lambda: self.multi_agent_group, + "managed_group": lambda: self.multi_agent_group, "tool_exec_environment_variables": lambda: self.tool_exec_environment_variables, "secrets": lambda: self.tool_exec_environment_variables, } @@ -342,6 +343,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin "identity_ids": [], "identities": [], "multi_agent_group": None, + "managed_group": None, "tool_exec_environment_variables": [], "secrets": [], } @@ -389,6 +391,7 @@ class Agent(SqlalchemyBase, OrganizationMixin, ProjectMixin, TemplateEntityMixin state["identity_ids"] = [i.id for i in identities] state["identities"] = [i.to_pydantic() for i in identities] state["multi_agent_group"] = multi_agent_group + state["managed_group"] = multi_agent_group state["tool_exec_environment_variables"] = tool_exec_environment_variables state["secrets"] = tool_exec_environment_variables diff --git a/letta/schemas/agent.py b/letta/schemas/agent.py index ebd3d9ba..8cfc0e4f 100644 --- a/letta/schemas/agent.py +++ b/letta/schemas/agent.py @@ -118,8 +118,8 @@ class AgentState(OrmMetadataBase, validate_assignment=True): description="If set to True, memory management will move to a background agent thread.", ) - multi_agent_group: Optional[Group] = Field(None, description="The multi-agent group that this agent manages") - + multi_agent_group: Optional[Group] = Field(None, description="The multi-agent group that this agent manages", deprecated=True) + managed_group: Optional[Group] = Field(None, description="The multi-agent group that this agent manages") # Run metrics last_run_completion: Optional[datetime] = Field(None, description="The timestamp when the agent last completed a run.") last_run_duration_ms: Optional[int] = Field(None, description="The duration in milliseconds of the agent's last run.") diff --git a/tests/managers/test_agent_manager.py b/tests/managers/test_agent_manager.py index 1da06405..d3183cef 100644 --- a/tests/managers/test_agent_manager.py +++ b/tests/managers/test_agent_manager.py @@ -1062,12 +1062,12 @@ async def test_agent_state_schema_unchanged(server: SyncServer): "description": (str, type(None)), "metadata": (dict, type(None)), # Memory and tools - "memory": Memory, + "memory": Memory, # deprecated "blocks": list, "tools": list, "sources": list, "tags": list, - "tool_exec_environment_variables": list, + "tool_exec_environment_variables": list, # deprecated "secrets": list, # Project and template fields "project_id": (str, type(None)), @@ -1081,7 +1081,8 @@ async def test_agent_state_schema_unchanged(server: SyncServer): "message_buffer_autoclear": bool, "enable_sleeptime": (bool, type(None)), # Multi-agent - "multi_agent_group": (Group, type(None)), + "multi_agent_group": (Group, type(None)), # deprecated + "managed_group": (Group, type(None)), # Run metrics "last_run_completion": (datetime, type(None)), "last_run_duration_ms": (int, type(None)),