diff --git a/codex-rs/app-server/tests/suite/v2/thread_archive.rs b/codex-rs/app-server/tests/suite/v2/thread_archive.rs index 3c830ed3e0..eb65f4419c 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_archive.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_archive.rs @@ -8,7 +8,7 @@ use codex_app_server_protocol::ThreadArchiveResponse; use codex_app_server_protocol::ThreadStartParams; use codex_app_server_protocol::ThreadStartResponse; use codex_core::ARCHIVED_SESSIONS_SUBDIR; -use codex_core::SESSIONS_SUBDIR; +use codex_core::find_conversation_path_by_id_str; use std::path::Path; use tempfile::TempDir; use tokio::time::timeout; @@ -27,16 +27,7 @@ async fn thread_archive_moves_rollout_into_archived_directory() -> Result<()> { let start_id = mcp .send_thread_start_request(ThreadStartParams { model: Some("mock-model".to_string()), - model_provider: None, - profile: None, - cwd: None, - approval_policy: None, - sandbox: None, - config: None, - base_instructions: None, - developer_instructions: None, - compact_prompt: None, - include_apply_patch_tool: None, + ..Default::default() }) .await?; let start_resp: JSONRPCResponse = timeout( @@ -47,11 +38,10 @@ async fn thread_archive_moves_rollout_into_archived_directory() -> Result<()> { let ThreadStartResponse { thread } = to_response::(start_resp)?; assert!(!thread.id.is_empty()); - // Construct the rollout path derived from the id we got back. - let rollout_path = codex_home - .path() - .join(SESSIONS_SUBDIR) - .join(format!("{}.jsonl", thread.id)); + // Locate the rollout path recorded for this thread id. + let rollout_path = find_conversation_path_by_id_str(codex_home.path(), &thread.id) + .await? + .expect("expected rollout path for thread id to exist"); assert!( rollout_path.exists(), "expected {} to exist", @@ -73,7 +63,9 @@ async fn thread_archive_moves_rollout_into_archived_directory() -> Result<()> { // Verify file moved. let archived_directory = codex_home.path().join(ARCHIVED_SESSIONS_SUBDIR); - let archived_rollout_path = archived_directory.join(format!("{}.jsonl", thread.id)); + // The archived file keeps the original filename (rollout-...-.jsonl). + let archived_rollout_path = + archived_directory.join(rollout_path.file_name().expect("rollout file name")); assert!( !rollout_path.exists(), "expected rollout path {} to be moved", diff --git a/codex-rs/app-server/tests/suite/v2/thread_resume.rs b/codex-rs/app-server/tests/suite/v2/thread_resume.rs index bb91ec74bf..c503d8138e 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_resume.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_resume.rs @@ -26,16 +26,7 @@ async fn thread_resume_returns_existing_thread() -> Result<()> { let start_id = mcp .send_thread_start_request(ThreadStartParams { model: Some("o3".to_string()), - model_provider: None, - profile: None, - cwd: None, - approval_policy: None, - sandbox: None, - config: None, - base_instructions: None, - developer_instructions: None, - compact_prompt: None, - include_apply_patch_tool: None, + ..Default::default() }) .await?; let start_resp: JSONRPCResponse = timeout( diff --git a/codex-rs/app-server/tests/suite/v2/thread_start.rs b/codex-rs/app-server/tests/suite/v2/thread_start.rs index 63c3bfc232..da25b5eb03 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_start.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_start.rs @@ -31,16 +31,7 @@ async fn thread_start_creates_thread_and_emits_started() -> Result<()> { let req_id = mcp .send_thread_start_request(ThreadStartParams { model: Some("o3".to_string()), - model_provider: None, - profile: None, - cwd: None, - approval_policy: None, - sandbox: None, - config: None, - base_instructions: None, - developer_instructions: None, - compact_prompt: None, - include_apply_patch_tool: None, + ..Default::default() }) .await?; diff --git a/codex-rs/app-server/tests/suite/v2/turn_start.rs b/codex-rs/app-server/tests/suite/v2/turn_start.rs index 55c1537322..312779b9f9 100644 --- a/codex-rs/app-server/tests/suite/v2/turn_start.rs +++ b/codex-rs/app-server/tests/suite/v2/turn_start.rs @@ -39,16 +39,7 @@ async fn turn_start_emits_notifications_and_accepts_model_override() -> Result<( let thread_req = mcp .send_thread_start_request(ThreadStartParams { model: Some("mock-model".to_string()), - model_provider: None, - profile: None, - cwd: None, - approval_policy: None, - sandbox: None, - config: None, - base_instructions: None, - developer_instructions: None, - compact_prompt: None, - include_apply_patch_tool: None, + ..Default::default() }) .await?; let thread_resp: JSONRPCResponse = timeout( @@ -148,16 +139,7 @@ async fn turn_start_accepts_local_image_input() -> Result<()> { let thread_req = mcp .send_thread_start_request(ThreadStartParams { model: Some("mock-model".to_string()), - model_provider: None, - profile: None, - cwd: None, - approval_policy: None, - sandbox: None, - config: None, - base_instructions: None, - developer_instructions: None, - compact_prompt: None, - include_apply_patch_tool: None, + ..Default::default() }) .await?; let thread_resp: JSONRPCResponse = timeout(