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): patch bug w/ sleeptime agents and client-side tool executions [LET-6081] (#6001)

Charles Packer4b371dd6fb91
diff --git a/fern/openapi.json b/fern/openapi.json
index f684e1efe..b6f8a58de 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 a3461d6fc..5905b72c8 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 57feca10a..eea13ac59 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),
)
]