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
@@ -81,7 +81,7 @@ impl PlanHandler {
}
};
if turn.collaboration_mode.mode == ModeKind::Plan {
if turn.mode == ModeKind::Plan {
return Err(FunctionCallError::RespondToModel(
"update_plan is a TODO/checklist tool and is not allowed in Plan mode".to_string(),
));