mirror of
https://github.com/openai/codex.git
synced 2026-05-03 04:42:20 +03:00
Add collaboration_mode to TurnContextItem (#9583)
## Summary - add optional `collaboration_mode` to `TurnContextItem` in rollouts - persist the current collaboration mode when recording turn context (sampling + compaction) ## Rationale We already persist turn context data for resume logic. Capturing collaboration mode in the rollout gives us the mode context for each turn, enabling follow‑up work to diff mode instructions correctly on resume. ## Changes - protocol: add optional `collaboration_mode` field to `TurnContextItem` - core: persist collaboration mode alongside other turn context settings in rollouts
This commit is contained in:
@@ -84,11 +84,17 @@ async fn run_compact_task_inner(
|
||||
let max_retries = turn_context.client.get_provider().stream_max_retries();
|
||||
let mut retries = 0;
|
||||
|
||||
// TODO: If we need to guarantee the persisted mode always matches the prompt used for this
|
||||
// turn, capture it in TurnContext at creation time. Using SessionConfiguration here avoids
|
||||
// duplicating model settings on TurnContext, but an Op after turn start could update the
|
||||
// session config before this write occurs.
|
||||
let collaboration_mode = sess.current_collaboration_mode().await;
|
||||
let rollout_item = RolloutItem::TurnContext(TurnContextItem {
|
||||
cwd: turn_context.cwd.clone(),
|
||||
approval_policy: turn_context.approval_policy,
|
||||
sandbox_policy: turn_context.sandbox_policy.clone(),
|
||||
model: turn_context.client.get_model(),
|
||||
collaboration_mode: Some(collaboration_mode),
|
||||
effort: turn_context.client.get_reasoning_effort(),
|
||||
summary: turn_context.client.get_reasoning_summary(),
|
||||
user_instructions: turn_context.user_instructions.clone(),
|
||||
|
||||
Reference in New Issue
Block a user