mirror of
https://github.com/openai/codex.git
synced 2026-05-04 05:11:37 +03:00
Fix thread/list cwd filtering for Windows verbatim paths (#17414)
Addresses #17302 Problem: `thread/list` compared cwd filters with raw path equality, so `resume --last` could miss Windows sessions when the saved cwd used a verbatim path form and the current cwd did not. Solution: Normalize cwd comparisons through the existing path comparison utilities before falling back to direct equality, and add Windows regression coverage for verbatim paths. I made this a general utility function and replaced all of the duplicated instance of it across the code base.
This commit is contained in:
@@ -1524,13 +1524,7 @@ async fn read_latest_turn_context(path: &Path) -> Option<TurnContextItem> {
|
||||
}
|
||||
|
||||
pub(crate) fn cwds_differ(current_cwd: &Path, session_cwd: &Path) -> bool {
|
||||
match (
|
||||
path_utils::normalize_for_path_comparison(current_cwd),
|
||||
path_utils::normalize_for_path_comparison(session_cwd),
|
||||
) {
|
||||
(Ok(current), Ok(session)) => current != session,
|
||||
_ => current_cwd != session_cwd,
|
||||
}
|
||||
!path_utils::paths_match_after_normalization(current_cwd, session_cwd)
|
||||
}
|
||||
|
||||
pub(crate) enum ResolveCwdOutcome {
|
||||
|
||||
@@ -1148,13 +1148,7 @@ fn thread_list_params(
|
||||
}
|
||||
|
||||
fn paths_match(a: &Path, b: &Path) -> bool {
|
||||
if let (Ok(ca), Ok(cb)) = (
|
||||
path_utils::normalize_for_path_comparison(a),
|
||||
path_utils::normalize_for_path_comparison(b),
|
||||
) {
|
||||
return ca == cb;
|
||||
}
|
||||
a == b
|
||||
path_utils::paths_match_after_normalization(a, b)
|
||||
}
|
||||
|
||||
#[cfg_attr(not(test), allow(dead_code))]
|
||||
|
||||
Reference in New Issue
Block a user