codex: fix cleared git metadata reads

This commit is contained in:
Tom Wiltzius
2026-04-16 13:26:33 -07:00
parent 9198963975
commit bfe192ed74
2 changed files with 17 additions and 0 deletions

View File

@@ -3208,6 +3208,9 @@ impl CodexMessageProcessor {
Some(None) => Some(None),
None => None,
};
let clears_git_info = matches!(git_sha, Some(None))
|| matches!(git_branch, Some(None))
|| matches!(git_origin_url, Some(None));
let updated = match state_db_ctx
.update_thread_git_info(
@@ -3236,6 +3239,18 @@ impl CodexMessageProcessor {
.await;
return;
}
if clears_git_info
&& let Err(err) = state_db_ctx
.touch_thread_updated_at(thread_uuid, Utc::now())
.await
{
self.send_internal_error(
request_id,
format!("failed to touch thread metadata for {thread_uuid}: {err}"),
)
.await;
return;
}
let Some(summary) =
read_summary_from_state_db_context_by_thread_id(Some(&state_db_ctx), thread_uuid).await

View File

@@ -114,6 +114,8 @@ async fn read_thread_from_rollout_path(
}
if let Some(git_info) = git_info_from_metadata(&metadata) {
thread.git_info = Some(git_info);
} else if metadata.updated_at > thread.updated_at {
thread.git_info = None;
}
}
if !found_sqlite_title