mirror of
https://github.com/openai/codex.git
synced 2026-11-03 19:53:25 +00:00
Annotate empty developer-section args
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Codex
parent
8b23405bd0
commit
e34d5757eb
@@ -3649,8 +3649,11 @@ impl Session {
|
||||
&self,
|
||||
turn_context: &TurnContext,
|
||||
) {
|
||||
self.record_context_updates_with_additional_developer_sections(turn_context, Vec::new())
|
||||
.await;
|
||||
self.record_context_updates_with_additional_developer_sections(
|
||||
turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
// Some turn-local guidance, such as explicit plugin mention hints, belongs in the canonical
|
||||
|
||||
@@ -961,7 +961,10 @@ async fn resumed_history_injects_initial_context_on_first_context_update_only()
|
||||
.await;
|
||||
expected.extend(
|
||||
session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await,
|
||||
);
|
||||
let history_after_seed = session.clone_history().await;
|
||||
@@ -1342,7 +1345,12 @@ async fn thread_rollback_drops_last_turn_from_history() {
|
||||
let (sess, tc, rx) = make_session_and_context_with_rx().await;
|
||||
let rollout_path = attach_rollout_recorder(&sess).await;
|
||||
|
||||
let initial_context = sess.build_initial_context(tc.as_ref(), Vec::new()).await;
|
||||
let initial_context = sess
|
||||
.build_initial_context(
|
||||
tc.as_ref(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let turn_1 = vec![
|
||||
user_message("turn 1 user"),
|
||||
assistant_message("turn 1 assistant"),
|
||||
@@ -1406,7 +1414,12 @@ async fn thread_rollback_clears_history_when_num_turns_exceeds_existing_turns()
|
||||
let (sess, tc, rx) = make_session_and_context_with_rx().await;
|
||||
attach_rollout_recorder(&sess).await;
|
||||
|
||||
let initial_context = sess.build_initial_context(tc.as_ref(), Vec::new()).await;
|
||||
let initial_context = sess
|
||||
.build_initial_context(
|
||||
tc.as_ref(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let turn_1 = vec![user_message("turn 1 user")];
|
||||
let mut full_history = Vec::new();
|
||||
full_history.extend(initial_context.clone());
|
||||
@@ -1432,7 +1445,12 @@ async fn thread_rollback_clears_history_when_num_turns_exceeds_existing_turns()
|
||||
async fn thread_rollback_fails_without_persisted_rollout_path() {
|
||||
let (sess, tc, rx) = make_session_and_context_with_rx().await;
|
||||
|
||||
let initial_context = sess.build_initial_context(tc.as_ref(), Vec::new()).await;
|
||||
let initial_context = sess
|
||||
.build_initial_context(
|
||||
tc.as_ref(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
sess.record_into_history(&initial_context, tc.as_ref())
|
||||
.await;
|
||||
|
||||
@@ -1749,7 +1767,12 @@ async fn thread_rollback_persists_marker_and_replays_cumulatively() {
|
||||
async fn thread_rollback_fails_when_turn_in_progress() {
|
||||
let (sess, tc, rx) = make_session_and_context_with_rx().await;
|
||||
|
||||
let initial_context = sess.build_initial_context(tc.as_ref(), Vec::new()).await;
|
||||
let initial_context = sess
|
||||
.build_initial_context(
|
||||
tc.as_ref(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
sess.record_into_history(&initial_context, tc.as_ref())
|
||||
.await;
|
||||
|
||||
@@ -1770,7 +1793,12 @@ async fn thread_rollback_fails_when_turn_in_progress() {
|
||||
async fn thread_rollback_fails_when_num_turns_is_zero() {
|
||||
let (sess, tc, rx) = make_session_and_context_with_rx().await;
|
||||
|
||||
let initial_context = sess.build_initial_context(tc.as_ref(), Vec::new()).await;
|
||||
let initial_context = sess
|
||||
.build_initial_context(
|
||||
tc.as_ref(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
sess.record_into_history(&initial_context, tc.as_ref())
|
||||
.await;
|
||||
|
||||
@@ -3703,7 +3731,11 @@ async fn build_settings_update_items_emits_environment_item_for_network_changes(
|
||||
|
||||
let reference_context_item = previous_context.to_turn_context_item();
|
||||
let update_items = session
|
||||
.build_settings_update_items(Some(&reference_context_item), ¤t_context, Vec::new())
|
||||
.build_settings_update_items(
|
||||
Some(&reference_context_item),
|
||||
¤t_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
|
||||
let environment_update = update_items
|
||||
@@ -3738,7 +3770,11 @@ async fn build_settings_update_items_emits_environment_item_for_time_changes() {
|
||||
|
||||
let reference_context_item = previous_context.to_turn_context_item();
|
||||
let update_items = session
|
||||
.build_settings_update_items(Some(&reference_context_item), ¤t_context, Vec::new())
|
||||
.build_settings_update_items(
|
||||
Some(&reference_context_item),
|
||||
¤t_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
|
||||
let environment_update = update_items
|
||||
@@ -3773,7 +3809,7 @@ async fn build_settings_update_items_emits_realtime_start_when_session_becomes_l
|
||||
.build_settings_update_items(
|
||||
Some(&previous_context.to_turn_context_item()),
|
||||
¤t_context,
|
||||
Vec::new(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -3802,7 +3838,7 @@ async fn build_settings_update_items_emits_realtime_end_when_session_stops_being
|
||||
.build_settings_update_items(
|
||||
Some(&previous_context.to_turn_context_item()),
|
||||
¤t_context,
|
||||
Vec::new(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -3836,7 +3872,11 @@ async fn build_settings_update_items_uses_previous_turn_settings_for_realtime_en
|
||||
.set_previous_turn_settings(Some(previous_turn_settings))
|
||||
.await;
|
||||
let update_items = session
|
||||
.build_settings_update_items(Some(&previous_context_item), ¤t_context, Vec::new())
|
||||
.build_settings_update_items(
|
||||
Some(&previous_context_item),
|
||||
¤t_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
|
||||
let developer_texts = developer_input_texts(&update_items);
|
||||
@@ -3854,7 +3894,10 @@ async fn build_initial_context_uses_previous_realtime_state() {
|
||||
turn_context.realtime_active = true;
|
||||
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let developer_texts = developer_input_texts(&initial_context);
|
||||
assert!(
|
||||
@@ -3870,7 +3913,10 @@ async fn build_initial_context_uses_previous_realtime_state() {
|
||||
state.set_reference_context_item(Some(previous_context_item));
|
||||
}
|
||||
let resumed_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let resumed_developer_texts = developer_input_texts(&resumed_context);
|
||||
assert!(
|
||||
@@ -3897,7 +3943,10 @@ async fn build_initial_context_omits_default_image_save_location_with_image_hist
|
||||
.await;
|
||||
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let developer_texts = developer_input_texts(&initial_context);
|
||||
assert!(
|
||||
@@ -3913,7 +3962,10 @@ async fn build_initial_context_omits_default_image_save_location_without_image_h
|
||||
let (session, turn_context) = make_session_and_context().await;
|
||||
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let developer_texts = developer_input_texts(&initial_context);
|
||||
|
||||
@@ -4028,7 +4080,10 @@ async fn build_initial_context_uses_previous_turn_settings_for_realtime_end() {
|
||||
.set_previous_turn_settings(Some(previous_turn_settings))
|
||||
.await;
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let developer_texts = developer_input_texts(&initial_context);
|
||||
assert!(
|
||||
@@ -4052,7 +4107,10 @@ async fn build_initial_context_restates_realtime_start_when_reference_context_is
|
||||
.set_previous_turn_settings(Some(previous_turn_settings))
|
||||
.await;
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let developer_texts = developer_input_texts(&initial_context);
|
||||
assert!(
|
||||
@@ -4072,7 +4130,10 @@ async fn record_context_updates_and_set_reference_context_item_injects_full_cont
|
||||
.await;
|
||||
let history = session.clone_history().await;
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(history.raw_items().to_vec(), initial_context);
|
||||
|
||||
@@ -4119,7 +4180,10 @@ async fn record_context_updates_and_set_reference_context_item_reinjects_full_co
|
||||
let mut expected_history = vec![compacted_summary];
|
||||
expected_history.extend(
|
||||
session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await,
|
||||
);
|
||||
assert_eq!(history.raw_items().to_vec(), expected_history);
|
||||
@@ -4165,7 +4229,11 @@ async fn record_context_updates_and_set_reference_context_item_persists_baseline
|
||||
}
|
||||
|
||||
let update_items = session
|
||||
.build_settings_update_items(Some(&previous_context_item), &turn_context, Vec::new())
|
||||
.build_settings_update_items(
|
||||
Some(&previous_context_item),
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(update_items, Vec::new());
|
||||
|
||||
@@ -4216,7 +4284,10 @@ async fn build_initial_context_prepends_model_switch_message() {
|
||||
.set_previous_turn_settings(Some(previous_turn_settings))
|
||||
.await;
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
|
||||
let ResponseItem::Message { role, content, .. } = &initial_context[0] else {
|
||||
@@ -4898,7 +4969,10 @@ async fn sample_rollout(
|
||||
// personality_spec) matches reconstruction.
|
||||
let reconstruction_turn = session.new_default_turn().await;
|
||||
let mut initial_context = session
|
||||
.build_initial_context(reconstruction_turn.as_ref(), Vec::new())
|
||||
.build_initial_context(
|
||||
reconstruction_turn.as_ref(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
// Ensure personality_spec is present when Personality is enabled, so expected matches
|
||||
// what reconstruction produces (build_initial_context may omit it when baked into model).
|
||||
|
||||
@@ -201,7 +201,10 @@ async fn run_compact_task_inner(
|
||||
InitialContextInjection::BeforeLastUserMessage
|
||||
) {
|
||||
let initial_context = sess
|
||||
.build_initial_context(turn_context.as_ref(), Vec::new())
|
||||
.build_initial_context(
|
||||
turn_context.as_ref(),
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
new_history =
|
||||
insert_initial_context_before_last_real_user_or_summary(new_history, initial_context);
|
||||
|
||||
@@ -178,7 +178,11 @@ pub(crate) async fn process_compacted_history(
|
||||
initial_context_injection,
|
||||
InitialContextInjection::BeforeLastUserMessage
|
||||
) {
|
||||
sess.build_initial_context(turn_context, Vec::new()).await
|
||||
sess.build_initial_context(
|
||||
turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
|
||||
@@ -10,7 +10,10 @@ async fn process_compacted_history_with_test_session(
|
||||
.set_previous_turn_settings(previous_turn_settings.cloned())
|
||||
.await;
|
||||
let initial_context = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
let refreshed = crate::compact_remote::process_compacted_history(
|
||||
&session,
|
||||
|
||||
@@ -196,7 +196,10 @@ fn out_of_range_truncation_drops_pre_user_active_turn_prefix() {
|
||||
async fn ignores_session_prefix_messages_when_truncating() {
|
||||
let (session, turn_context) = make_session_and_context().await;
|
||||
let mut items = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
items.push(user_msg("feature request"));
|
||||
items.push(assistant_msg("ack"));
|
||||
|
||||
@@ -125,7 +125,10 @@ fn truncates_rollout_from_start_applies_thread_rollback_markers() {
|
||||
async fn ignores_session_prefix_messages_when_truncating_rollout_from_start() {
|
||||
let (session, turn_context) = make_session_and_context().await;
|
||||
let mut items = session
|
||||
.build_initial_context(&turn_context, Vec::new())
|
||||
.build_initial_context(
|
||||
&turn_context,
|
||||
/*additional_developer_sections*/ Vec::new(),
|
||||
)
|
||||
.await;
|
||||
items.push(user_msg("feature request"));
|
||||
items.push(assistant_msg("ack"));
|
||||
|
||||
Reference in New Issue
Block a user