diff --git a/codex-rs/core/src/context_manager/updates.rs b/codex-rs/core/src/context_manager/updates.rs index 07c52a3e88..e39d37b9a2 100644 --- a/codex-rs/core/src/context_manager/updates.rs +++ b/codex-rs/core/src/context_manager/updates.rs @@ -199,7 +199,7 @@ pub(crate) fn build_settings_update_items( // inputs or add explicit replay events so fork/resume can diff everything // deterministically. let contextual_user_message = build_environment_update_item(previous, next, shell); - let mut developer_update_sections = [ + let developer_update_sections = [ // Keep model-switch instructions first so model-specific guidance is read before // any other context diffs on this turn. build_model_instructions_update_item(previous_turn_settings, next), @@ -211,8 +211,8 @@ pub(crate) fn build_settings_update_items( .into_iter() .flatten() .map(DeveloperInstructions::into_text) + .chain(additional_developer_sections) .collect::>(); - developer_update_sections.extend(additional_developer_sections); let mut items = Vec::with_capacity(2); if let Some(developer_message) = build_developer_update_item(developer_update_sections) {