Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions apis/src/openai/conversations/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use super::{
};
use crate::{
openai::responses::{DEFAULT_TENANT_ID, TENANT_METADATA_KEY, state::ResponsesState},
store::{ConversationItemStore, ConversationRecord, PostgresResponseStore, SqliteResponseStore, StoreError},
store::{ConversationItemStore, PostgresResponseStore, SqliteResponseStore, StoreError},
};

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -601,14 +601,9 @@ async fn persist_items(

/// Refresh the denormalized conversation message cache after item mutation.
async fn refresh_message_cache(store: &dyn ConversationItemStore, tenant_id: &str, conversation_id: &str) {
let record = ConversationRecord {
conversation_id: conversation_id.to_owned(),
tenant_id: tenant_id.to_owned(),
created_at: 0,
metadata: Value::Object(serde_json::Map::default()),
messages: Value::Null,
};
if let Err(e) = handlers::sync_conversation_messages(store, record).await {
// The append-back path holds no pre-mutation cache snapshot, so it syncs with
// `None`; the refresh then re-reads the live cache as the swap's expected value.
if let Err(e) = handlers::sync_conversation_messages(store, tenant_id, conversation_id, None).await {
warn!(error = %e, conversation_id, "conversation message sync failed after append-back");
}
}
Expand Down
Loading
Loading