mirror of
https://github.com/openai/codex.git
synced 2026-05-15 08:42:34 +00:00
codex: clarify thread read fallback comments
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user