codex: clarify thread read fallback comments

This commit is contained in:
Tom Wiltzius
2026-04-16 13:28:40 -07:00
parent bfe192ed74
commit d0beef9054
2 changed files with 7 additions and 4 deletions

View File

@@ -3927,10 +3927,9 @@ impl CodexMessageProcessor {
let mut thread =
build_thread_from_snapshot(thread_id, &config_snapshot, loaded_rollout_path.clone());
// Temporary live-thread metadata shim: stored-thread metadata is owned by
// ThreadStore, but loaded threads that are not yet readable from the store may
// still have local metadata. Keep this compatibility path centralized here so
// future remote threadstore implementations have one app-server boundary to replace.
// Temporary live-thread metadata shim: loaded threads that are not yet
// readable from the store may still have local metadata, so use it to fill
// summary fields for the live fallback view.
let loaded_state_db = loaded_thread.state_db();
let summary = match loaded_state_db.as_ref() {
Some(state_db) => {

View File

@@ -17,6 +17,7 @@ use crate::StoredThreadHistory;
use crate::ThreadStoreError;
use crate::ThreadStoreResult;
/// Reads a persisted thread by preferring discoverable rollout files, then SQLite metadata for external or legacy rows.
pub(super) async fn read_thread(
store: &LocalThreadStore,
params: ReadThreadParams,
@@ -107,6 +108,9 @@ async fn read_thread_from_rollout_path(
.ok()
.and_then(|meta_line| meta_line.meta.forked_from_id);
let mut found_sqlite_title = false;
// This overlay is different from the no-preview fallback above: the rollout
// summary was readable, so SQLite only supplies mutable metadata such as
// user-edited title, git fields, or explicit git-field clears.
if let Ok(Some(metadata)) = read_sqlite_metadata(store, thread.thread_id).await {
if let Some(title) = distinct_title(&metadata) {
found_sqlite_title = true;