Skip to content

fix: gate conversation sync on store flag to prevent data leak when store=false#5305

Open
jaideepr97 wants to merge 7 commits intollamastack:mainfrom
jaideepr97:fix/store-false-conversation-leak
Open

fix: gate conversation sync on store flag to prevent data leak when store=false#5305
jaideepr97 wants to merge 7 commits intollamastack:mainfrom
jaideepr97:fix/store-false-conversation-leak

Conversation

@jaideepr97
Copy link
Copy Markdown
Contributor

This patch was generated by Claude.

Summary

  • Fix store=false ignoring conversation sync: when a user passes store=false with a conversation ID, the response object was correctly not persisted but conversation messages were still written to the database via _sync_response_to_conversation and store_conversation_messages. This adds and store to the terminal-event condition gate so conversation syncing respects the store flag.
  • Add 3 regression tests covering store=false non-streaming, store=true non-streaming (positive case), and store=false streaming modes with conversation IDs.

Closes #5304

Test plan

  • New regression tests in test_openai_responses_conversations.py::TestStoreFalseConversationLeak (3 tests)
  • Full responses unit test suite passes (226 tests, 0 failures)
  • Verified against live server: GET /v1/conversations/{id}/items returns empty after store=false response

…tore=false

When a user passes store=false with a conversation ID, the response
object was correctly not persisted but conversation messages were still
written to the database. This adds `and store` to the terminal-event
condition so conversation syncing respects the store flag.

This fix was generated by Claude.

Closes llamastack#5304

Signed-off-by: Jaideep Rao <jrao@redhat.com>
Made-with: Cursor
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 25, 2026
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.

store=false still persists conversation messages to the database

2 participants