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

+4 -1
View File
@@ -130,7 +130,10 @@ pub(super) async fn spawn_review_thread(
timezone: parent_turn_context.timezone.clone(),
app_server_client_name: parent_turn_context.app_server_client_name.clone(),
developer_instructions: None,
collaboration_mode: parent_turn_context.collaboration_mode.clone(),
mode: parent_turn_context.mode,
collaboration_mode_developer_instructions: parent_turn_context
.collaboration_mode_developer_instructions
.clone(),
multi_agent_version: MultiAgentVersion::Disabled,
personality: parent_turn_context.personality,
approval_policy: parent_turn_context.approval_policy.clone(),