codex: auto-unarchive archived sessions safely on resume

Preserve the auto-unarchive-on-resume behavior while keeping archived-session lookup safe. This carries the rollout lookup hardening, the resume path updates, and the cross-platform guardian/TUI test fixes needed for current CI.
This commit is contained in:
Friel
2026-03-28 11:35:15 -07:00
parent 65f631c3d6
commit 328706da37
8 changed files with 242 additions and 9 deletions
@@ -213,6 +213,7 @@ use codex_core::exec::ExecExpiration;
use codex_core::exec::ExecParams;
use codex_core::exec_env::create_env;
use codex_core::find_archived_thread_path_by_id_str;
use codex_core::find_or_unarchive_thread_path_by_id_str;
use codex_core::find_thread_name_by_id;
use codex_core::find_thread_names_by_ids;
use codex_core::find_thread_path_by_id_str;
@@ -3852,7 +3853,7 @@ impl CodexMessageProcessor {
if path.exists() {
path
} else {
match find_thread_path_by_id_str(
match find_or_unarchive_thread_path_by_id_str(
&self.config.codex_home,
&existing_thread_id.to_string(),
)
@@ -3878,7 +3879,7 @@ impl CodexMessageProcessor {
}
}
} else {
match find_thread_path_by_id_str(
match find_or_unarchive_thread_path_by_id_str(
&self.config.codex_home,
&existing_thread_id.to_string(),
)
@@ -4036,7 +4037,7 @@ impl CodexMessageProcessor {
}
};
match find_thread_path_by_id_str(
match find_or_unarchive_thread_path_by_id_str(
&self.config.codex_home,
&existing_thread_id.to_string(),
)