mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
preserve legacy names in thread list
This commit is contained in:
@@ -1809,12 +1809,20 @@ fn thread_item_from_state_list_item(item: codex_state::ThreadListItem) -> Thread
|
||||
let source = serde_json::from_str(item.source.as_str())
|
||||
.or_else(|_| serde_json::from_value(Value::String(item.source)))
|
||||
.unwrap_or(SessionSource::Unknown);
|
||||
let name = item
|
||||
.name
|
||||
.filter(|name| !name.trim().is_empty())
|
||||
.or_else(|| {
|
||||
let title = item.title.trim();
|
||||
(!title.is_empty() && item.first_user_message.as_deref().map(str::trim) != Some(title))
|
||||
.then(|| item.title.clone())
|
||||
});
|
||||
ThreadItem {
|
||||
path: item.rollout_path,
|
||||
thread_id: Some(item.id),
|
||||
first_user_message: item.first_user_message,
|
||||
preview: item.preview,
|
||||
name: item.name,
|
||||
name,
|
||||
cwd: Some(item.cwd),
|
||||
git_branch: item.git_branch,
|
||||
git_sha: item.git_sha,
|
||||
|
||||
Reference in New Issue
Block a user