Derive collaboration settings from turn context (#32900)

## Why

`TurnContext` stored model and reasoning settings both as resolved turn fields and inside `CollaborationMode`, requiring the copies to stay synchronized when the model changed.

## What changed

- Store the mode and collaboration-mode developer instructions directly on `TurnContext`.
- Reconstruct `CollaborationMode` from those values plus the turn's current model and reasoning effort when callers need it.
- Read the mode directly for plan-mode checks, lifecycle events, and telemetry.

GitOrigin-RevId: b8fccafdd5d5cbccc84bc70d542588087ddf0093
This commit is contained in:
Ahmed Ibrahim authored and copyberry committed 2026-07-13 23:48:42 +00:00
1 parent 75470c3e2f
commit 4657ab06c6
16 files changed
+58 -41

No files matched your search

+1 -1
View File
@@ -82,7 +82,7 @@ pub(crate) async fn run_remote_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.collaboration_mode.mode,
collaboration_mode_kind: turn_context.mode,
});
sess.send_event(&turn_context, start_event).await;