fix legacy title reconciliation

This commit is contained in:
anais
2026-06-22 13:38:17 -07:00
parent 985e59537d
commit 2d7edbc5b9
2 changed files with 5 additions and 2 deletions

View File

@@ -587,7 +587,7 @@ pub async fn read_repair_rollout_path(
.await
{
Ok(true) => return,
Ok(false) => saw_existing_metadata = false,
Ok(false) => return,
Err(err) => {
warn!(
"state db read-repair update failed for {}: {err}",

View File

@@ -918,7 +918,10 @@ ON CONFLICT(id) DO UPDATE SET
name = COALESCE(
threads.name,
CASE
WHEN threads.title <> '' AND threads.title <> excluded.title THEN threads.title
WHEN threads.title <> ''
AND (threads.first_user_message = '' OR trim(threads.title) <> trim(threads.first_user_message))
AND threads.title <> excluded.title
THEN threads.title
ELSE excluded.name
END
),