From 2d7edbc5b948933220e19a1116c4e5285fb53e49 Mon Sep 17 00:00:00 2001 From: anais Date: Mon, 22 Jun 2026 13:38:17 -0700 Subject: [PATCH] fix legacy title reconciliation --- codex-rs/rollout/src/state_db.rs | 2 +- codex-rs/state/src/runtime/threads.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/codex-rs/rollout/src/state_db.rs b/codex-rs/rollout/src/state_db.rs index 2d7e4e798b..c76aaa5e62 100644 --- a/codex-rs/rollout/src/state_db.rs +++ b/codex-rs/rollout/src/state_db.rs @@ -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}", diff --git a/codex-rs/state/src/runtime/threads.rs b/codex-rs/state/src/runtime/threads.rs index 3c0d473420..5e1cf9beb4 100644 --- a/codex-rs/state/src/runtime/threads.rs +++ b/codex-rs/state/src/runtime/threads.rs @@ -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 ),