Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions codex-rs/rollout/src/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,13 +1030,13 @@ fn fill_missing_thread_item_metadata(item: &mut ThreadItem, state_item: ThreadIt
if item.cwd.is_none() {
item.cwd = cwd;
}
if item.git_branch.is_none() {
if git_branch.is_some() {
item.git_branch = git_branch;
}
if item.git_sha.is_none() {
if git_sha.is_some() {
item.git_sha = git_sha;
}
if item.git_origin_url.is_none() {
if git_origin_url.is_some() {
item.git_origin_url = git_origin_url;
}
if item.source.is_none() {
Expand Down
8 changes: 4 additions & 4 deletions codex-rs/rollout/src/recorder_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ async fn list_threads_metadata_filter_overlays_state_db_list_metadata() -> std::
}

#[test]
fn fill_missing_thread_item_metadata_preserves_filesystem_identity() {
fn fill_missing_thread_item_metadata_preserves_identity_and_prefers_state_git_fields() {
let filesystem_thread_id = ThreadId::new();
let state_thread_id = ThreadId::new();
let filesystem_path = PathBuf::from("/tmp/filesystem-rollout.jsonl");
Expand All @@ -789,9 +789,9 @@ fn fill_missing_thread_item_metadata_preserves_filesystem_identity() {
thread_id: Some(filesystem_thread_id),
first_user_message: Some("filesystem message".to_string()),
cwd: None,
git_branch: None,
git_sha: None,
git_origin_url: None,
git_branch: Some("filesystem-branch".to_string()),
git_sha: Some("filesystem-sha".to_string()),
git_origin_url: Some("https://example.com/filesystem.git".to_string()),
source: None,
agent_nickname: None,
agent_role: None,
Expand Down
Loading