diff --git a/codex-rs/app-server/src/codex_message_processor.rs b/codex-rs/app-server/src/codex_message_processor.rs index 6c3b4e6562..400b12cf6d 100644 --- a/codex-rs/app-server/src/codex_message_processor.rs +++ b/codex-rs/app-server/src/codex_message_processor.rs @@ -2489,8 +2489,8 @@ impl CodexMessageProcessor { sandbox_mode: sandbox.map(SandboxMode::to_core), codex_linux_sandbox_exe: self.arg0_paths.codex_linux_sandbox_exe.clone(), main_execve_wrapper_exe: self.arg0_paths.main_execve_wrapper_exe.clone(), - base_instructions: thread_instruction_override(base_instructions), - developer_instructions: thread_instruction_override(developer_instructions), + base_instructions: base_instructions.map(Option::unwrap_or_default), + developer_instructions: developer_instructions.map(Option::unwrap_or_default), personality, ..Default::default() } @@ -7843,14 +7843,6 @@ fn normalize_thread_list_cwd_filter( }) } -fn thread_instruction_override(instructions: Option>) -> Option { - match instructions { - None => None, - Some(None) => Some(String::new()), - Some(Some(instructions)) => Some(instructions), - } -} - #[cfg(test)] mod thread_list_cwd_filter_tests { use super::normalize_thread_list_cwd_filter; 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 8852dcf716..77f60e0efd 100644 --- a/codex-rs/app-server/tests/suite/v2/turn_start.rs +++ b/codex-rs/app-server/tests/suite/v2/turn_start.rs @@ -241,8 +241,8 @@ async fn turn_start_honors_explicit_null_thread_instructions() -> Result<()> { ); let developer_texts = request.message_input_texts("developer"); assert!( - developer_texts.is_empty(), - "did not expect developer instruction messages: {developer_texts:?}" + developer_texts.iter().all(|text| !text.is_empty()), + "did not expect empty developer instruction messages: {developer_texts:?}" ); }