From 4b371dd6fb91a37ed595a331c76bfa36cefeb396 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Thu, 6 Nov 2025 10:47:36 -0800 Subject: [PATCH] fix(core): patch bug w/ sleeptime agents and client-side tool executions [LET-6081] (#6001) * fix(core): patch bug w/ sleeptime agents and client-side tool executions * fix: add groupid to approvalcreate * chore: just stage-api && just publish-api --- fern/openapi.json | 12 ++++++++++++ letta/schemas/message.py | 1 + letta/server/rest_api/utils.py | 3 +++ 3 files changed, 16 insertions(+) diff --git a/fern/openapi.json b/fern/openapi.json index f684e1ef..b6f8a58d 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -19233,6 +19233,18 @@ "title": "Reason", "description": "An optional explanation for the provided approval status", "deprecated": true + }, + "group_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Group Id", + "description": "The multi-agent group that the message was sent in" } }, "type": "object", diff --git a/letta/schemas/message.py b/letta/schemas/message.py index a3461d6f..5905b72c 100644 --- a/letta/schemas/message.py +++ b/letta/schemas/message.py @@ -134,6 +134,7 @@ class ApprovalCreate(MessageCreateBase): approve: Optional[bool] = Field(None, description="Whether the tool has been approved", deprecated=True) approval_request_id: Optional[str] = Field(None, description="The message ID of the approval request", deprecated=True) reason: Optional[str] = Field(None, description="An optional explanation for the provided approval status", deprecated=True) + group_id: Optional[str] = Field(default=None, description="The multi-agent group that the message was sent in") @model_validator(mode="after") def migrate_deprecated_fields(self): diff --git a/letta/server/rest_api/utils.py b/letta/server/rest_api/utils.py index 57feca10..eea13ac5 100644 --- a/letta/server/rest_api/utils.py +++ b/letta/server/rest_api/utils.py @@ -196,6 +196,9 @@ def create_approval_response_message_from_input( denial_reason=input_message.reason, approvals=[maybe_convert_tool_return_message(approval) for approval in input_message.approvals], run_id=run_id, + group_id=input_message.group_id + if input_message.group_id + else (agent_state.multi_agent_group.id if agent_state.multi_agent_group else None), ) ]