diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 5cfc3d4bf6..5f0ce0d4ba 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -202,13 +202,6 @@ fn maybe_push_chat_wire_api_deprecation( }); } -fn compute_is_up_to_date(codex_home: &std::path::Path) -> bool { - let version_file = codex_home.join(crate::version::VERSION_FILENAME); - crate::version::read_latest_version(&version_file) - .and_then(|latest| crate::version::is_up_to_date(&latest, env!("CARGO_PKG_VERSION"))) - .unwrap_or(true) -} - impl Codex { /// Spawn a new [`Codex`] and initialize the session. pub async fn spawn( @@ -2647,6 +2640,13 @@ pub(super) fn get_last_assistant_message_from_turn(responses: &[ResponseItem]) - }) } +fn compute_is_up_to_date(codex_home: &std::path::Path) -> bool { + let version_file = codex_home.join(crate::version::VERSION_FILENAME); + crate::version::read_latest_version(&version_file) + .and_then(|latest| crate::version::is_up_to_date(&latest, env!("CARGO_PKG_VERSION"))) + .unwrap_or(true) +} + #[cfg(test)] pub(crate) use tests::make_session_and_context;