Snapshot resolved settings for each model step (#40651)

## Why

Thread settings can change while a turn is running, and delegated review or
compaction steps can select a different model. Each request needs a consistent
set of settings resolved against the model that will execute it.

## What changed

- Capture immutable resolved settings for each model step, including model
  metadata, reasoning options, service tier, approvals, and personality.
- Keep in-flight steps on their captured settings while applying thread updates
  to subsequent work.
- Resolve inherited reasoning summaries and filter service tiers against the
  selected model and feature configuration for review and compaction steps.

## Testing

Added coverage for settings updates during paused turns, model changes,
previous-model compaction, review-model defaults, and service-tier filtering.

GitOrigin-RevId: fca4b3b305379f1bf26a5cac75ee0dd1747ac1f6
This commit is contained in:
joeflorencio-openai authored and copyberry committed 2026-08-25 17:41:22 +00:00
1 parent ba6cf9c692
commit 68301fa45f
68 files changed
+1393 -516

No files matched your search

+6 -6
View File
@@ -155,7 +155,7 @@ pub(crate) async fn run_compact_task(
trace_id: turn_context.trace_id.clone(),
started_at: turn_context.turn_timing_state.started_at_unix_secs().await,
model_context_window: turn_context.model_context_window(),
collaboration_mode_kind: turn_context.mode,
collaboration_mode_kind: turn_context.mode(),
});
sess.send_event(&turn_context, start_event).await;
run_compact_task_inner(
@@ -257,7 +257,7 @@ async fn run_compact_task_inner_impl(
let mut history = sess.clone_history().await;
history.record_items(
&[initial_input_for_turn.into()],
turn_context.model_info.truncation_policy.into(),
turn_context.model_info().truncation_policy.into(),
);
let max_retries = turn_context.provider.info().stream_max_retries();
@@ -277,7 +277,7 @@ async fn run_compact_task_inner_impl(
// Clone is required because of the loop
let turn_input = history
.clone()
.for_prompt(&turn_context.model_info.input_modalities);
.for_prompt(&turn_context.model_info().input_modalities);
let turn_input_len = turn_input.len();
let prompt = Prompt {
input: turn_input,
@@ -742,10 +742,10 @@ async fn drain_to_completed(
let mut stream = client_session
.stream(
prompt,
&turn_context.model_info,
turn_context.model_info(),
&turn_context.session_telemetry,
turn_context.reasoning_effort.clone(),
turn_context.reasoning_summary,
turn_context.reasoning_effort().cloned(),
turn_context.reasoning_summary(),
turn_context.config.service_tier.clone(),
responses_metadata,
// Rollout tracing currently models remote compaction only; local compaction streams