mirror of
https://github.com/openai/codex.git
synced 2026-04-26 15:45:02 +00:00
Leverage state DB metadata for thread summaries (#10621)
Summary: - read conversation summaries and cwd info from the state DB when possible so we no longer rely on rollout files for metadata and avoid extra I/O - persist CLI version in thread metadata, surface it through summary builders, and add the necessary DB migration hooks - simplify thread listing by using enriched state DB data directly rather than reading rollout heads Testing: - Not run (not requested)
This commit is contained in:
@@ -169,7 +169,7 @@ async fn backfill_scans_existing_rollouts() -> Result<()> {
|
||||
assert_eq!(metadata.id, thread_id);
|
||||
assert_eq!(metadata.rollout_path, rollout_path);
|
||||
assert_eq!(metadata.model_provider, default_provider);
|
||||
assert!(metadata.has_user_event);
|
||||
assert!(metadata.first_user_message.is_some());
|
||||
|
||||
let mut stored_tools = None;
|
||||
for _ in 0..40 {
|
||||
@@ -221,7 +221,7 @@ async fn user_messages_persist_in_state_db() -> Result<()> {
|
||||
metadata = db.get_thread(thread_id).await?;
|
||||
if metadata
|
||||
.as_ref()
|
||||
.map(|entry| entry.has_user_event)
|
||||
.map(|entry| entry.first_user_message.is_some())
|
||||
.unwrap_or(false)
|
||||
{
|
||||
break;
|
||||
@@ -230,7 +230,7 @@ async fn user_messages_persist_in_state_db() -> Result<()> {
|
||||
}
|
||||
|
||||
let metadata = metadata.expect("thread should exist in state db");
|
||||
assert!(metadata.has_user_event);
|
||||
assert!(metadata.first_user_message.is_some());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user