diff --git a/codex-rs/core/src/codex_delegate.rs b/codex-rs/core/src/codex_delegate.rs index b123a8a3f..c0fa0bf78 100644 --- a/codex-rs/core/src/codex_delegate.rs +++ b/codex-rs/core/src/codex_delegate.rs @@ -36,6 +36,7 @@ pub(crate) async fn run_codex_conversation_interactive( parent_session: Arc, parent_ctx: Arc, cancel_token: CancellationToken, + initial_history: Option, ) -> Result { let (tx_sub, rx_sub) = async_channel::bounded(SUBMISSION_CHANNEL_CAPACITY); let (tx_ops, rx_ops) = async_channel::bounded(SUBMISSION_CHANNEL_CAPACITY); @@ -43,7 +44,7 @@ pub(crate) async fn run_codex_conversation_interactive( let CodexSpawnOk { codex, .. } = Codex::spawn( config, auth_manager, - InitialHistory::New, + initial_history.unwrap_or(InitialHistory::New), SessionSource::SubAgent(SubAgentSource::Review), ) .await?; @@ -93,6 +94,7 @@ pub(crate) async fn run_codex_conversation_one_shot( parent_session: Arc, parent_ctx: Arc, cancel_token: CancellationToken, + initial_history: Option, ) -> Result { // Use a child token so we can stop the delegate after completion without // requiring the caller to cancel the parent token. @@ -103,6 +105,7 @@ pub(crate) async fn run_codex_conversation_one_shot( parent_session, parent_ctx, child_cancel.clone(), + initial_history, ) .await?; diff --git a/codex-rs/core/src/tasks/review.rs b/codex-rs/core/src/tasks/review.rs index 286eefa6f..57258f4cd 100644 --- a/codex-rs/core/src/tasks/review.rs +++ b/codex-rs/core/src/tasks/review.rs @@ -90,6 +90,7 @@ async fn start_review_conversation( session.clone_session(), ctx.clone(), cancellation_token, + None, ) .await) .ok()