From 82c01368fce2d5db2285cbd86d88e7c5fb86df56 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Thu, 22 Jan 2026 19:18:43 -0800 Subject: [PATCH] feat: add conversation_id to message search results (#9056) * feat: add conversation_id to message search results Add conversation_id field to all *MessageListResult classes (SystemMessageListResult, UserMessageListResult, ReasoningMessageListResult, AssistantMessageListResult) so that conversation IDs are returned from the /messages/search endpoint alongside agent IDs. Fixes #9055 Co-authored-by: Charles Packer * chore: regenerate SDK and OpenAPI spec Regenerate autogenerated files after adding conversation_id to message search result schemas. Co-authored-by: Sarah Wooders --------- Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com> Co-authored-by: Charles Packer Co-authored-by: Sarah Wooders --- fern/openapi.json | 48 ++++++++++++++++++++++++++++++++++ letta/schemas/letta_message.py | 16 ++++++++++++ letta/schemas/message.py | 4 +++ 3 files changed, 68 insertions(+) diff --git a/fern/openapi.json b/fern/openapi.json index b9def2e2..4e3fead5 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -26630,6 +26630,18 @@ "title": "Agent Id", "description": "The unique identifier of the agent that owns the message." }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Conversation Id", + "description": "The unique identifier of the conversation that the message belongs to." + }, "created_at": { "type": "string", "format": "date-time", @@ -40045,6 +40057,18 @@ "title": "Agent Id", "description": "The unique identifier of the agent that owns the message." }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Conversation Id", + "description": "The unique identifier of the conversation that the message belongs to." + }, "created_at": { "type": "string", "format": "date-time", @@ -42592,6 +42616,18 @@ "title": "Agent Id", "description": "The unique identifier of the agent that owns the message." }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Conversation Id", + "description": "The unique identifier of the conversation that the message belongs to." + }, "created_at": { "type": "string", "format": "date-time", @@ -45295,6 +45331,18 @@ "title": "Agent Id", "description": "The unique identifier of the agent that owns the message." }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Conversation Id", + "description": "The unique identifier of the conversation that the message belongs to." + }, "created_at": { "type": "string", "format": "date-time", diff --git a/letta/schemas/letta_message.py b/letta/schemas/letta_message.py index 712071ae..b90628dd 100644 --- a/letta/schemas/letta_message.py +++ b/letta/schemas/letta_message.py @@ -569,6 +569,10 @@ class SystemMessageListResult(UpdateSystemMessage): default=None, description="The unique identifier of the agent that owns the message.", ) + conversation_id: str | None = Field( + default=None, + description="The unique identifier of the conversation that the message belongs to.", + ) created_at: datetime = Field(..., description="The time the message was created in ISO format.") @@ -587,6 +591,10 @@ class UserMessageListResult(UpdateUserMessage): default=None, description="The unique identifier of the agent that owns the message.", ) + conversation_id: str | None = Field( + default=None, + description="The unique identifier of the conversation that the message belongs to.", + ) created_at: datetime = Field(..., description="The time the message was created in ISO format.") @@ -605,6 +613,10 @@ class ReasoningMessageListResult(UpdateReasoningMessage): default=None, description="The unique identifier of the agent that owns the message.", ) + conversation_id: str | None = Field( + default=None, + description="The unique identifier of the conversation that the message belongs to.", + ) created_at: datetime = Field(..., description="The time the message was created in ISO format.") @@ -623,6 +635,10 @@ class AssistantMessageListResult(UpdateAssistantMessage): default=None, description="The unique identifier of the agent that owns the message.", ) + conversation_id: str | None = Field( + default=None, + description="The unique identifier of the conversation that the message belongs to.", + ) created_at: datetime = Field(..., description="The time the message was created in ISO format.") diff --git a/letta/schemas/message.py b/letta/schemas/message.py index 5520249f..22ed104a 100644 --- a/letta/schemas/message.py +++ b/letta/schemas/message.py @@ -395,6 +395,7 @@ class Message(BaseMessage): message_type=lm.message_type, content=lm.content, agent_id=message.agent_id, + conversation_id=message.conversation_id, created_at=message.created_at, ) ) @@ -405,6 +406,7 @@ class Message(BaseMessage): message_type=lm.message_type, content=lm.content, agent_id=message.agent_id, + conversation_id=message.conversation_id, created_at=message.created_at, ) ) @@ -415,6 +417,7 @@ class Message(BaseMessage): message_type=lm.message_type, reasoning=lm.reasoning, agent_id=message.agent_id, + conversation_id=message.conversation_id, created_at=message.created_at, ) ) @@ -425,6 +428,7 @@ class Message(BaseMessage): message_type=lm.message_type, content=lm.content, agent_id=message.agent_id, + conversation_id=message.conversation_id, created_at=message.created_at, ) )