Skip to content

Conversation

@gyliu513
Copy link
Contributor

@gyliu513 gyliu513 commented Jan 28, 2026

What does this PR do?

Fixed #4718

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 28, 2026
@gyliu513 gyliu513 changed the title Fix conversation items sync for Responses API fix: Fix conversation items sync for Responses API Jan 28, 2026
Copy link
Collaborator

@mattf mattf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the items should not be returned when retrieving the conversation

@franciscojavierarceo
Copy link
Collaborator

@mattf +1 this was a bug in my original PR #3429

@gyliu513
Copy link
Contributor Author

thanks @franciscojavierarceo and @mattf , seeme we can just remove items from coversation, but end user can query item via conversations/:id/items, this also align with OpenAI spec, so I think I need to remove items when retrive conversation, comments?

GET /v1/conversations/{conversation_id} ⁠

{
  "id": "conv_123",
  "object": "conversation",
  "created_at": 1741900000,
  "metadata": {"topic": "demo"}
}

Create conversation

{
  "id": "conv_123",
  "object": "conversation",
  "created_at": 1741900000,
  "metadata": {"topic": "demo"}
}

@gyliu513 gyliu513 force-pushed the item branch 2 times, most recently from 5b49fe2 to afc55f6 Compare January 29, 2026 18:02
@gyliu513 gyliu513 changed the title fix: Fix conversation items sync for Responses API fix: Deprecate items when create conversation Jan 29, 2026
Copy link
Collaborator

@mattf mattf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a test to verify that items is not returned on creation or retrieval

@gyliu513
Copy link
Contributor Author

@mattf Done, thanks

conversation = await service.create_conversation(CreateConversationRequest(metadata={"test": "value"}))

# Verify items is None or not present in creation response
assert conversation.items is None, "items should be None when creating a conversation"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tests that items exists and is none, it shouldn't exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mattf mattf merged commit 9f5cc18 into llamastack:main Feb 9, 2026
46 checks passed
@gyliu513 gyliu513 deleted the item branch February 9, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Responses API with conversation_id set does not store conversation items in openai_conversations table

3 participants