mirror of
https://github.com/openai/codex.git
synced 2026-11-02 08:19:52 +00:00
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:
1 parent
75470c3e2f
commit
4657ab06c6
16 files changed
+58
-41
No files matched your search
@@ -70,13 +70,11 @@ fn build_collaboration_mode_update_item(
|
||||
}
|
||||
|
||||
let prev = previous?;
|
||||
if prev.collaboration_mode.as_ref() != Some(&next.collaboration_mode) {
|
||||
let collaboration_mode = next.collaboration_mode();
|
||||
if prev.collaboration_mode.as_ref() != Some(&collaboration_mode) {
|
||||
// If the next mode has empty developer instructions, this returns None and we emit no
|
||||
// update, so prior collaboration instructions remain in the prompt history.
|
||||
Some(
|
||||
CollaborationModeInstructions::from_collaboration_mode(&next.collaboration_mode)?
|
||||
.render(),
|
||||
)
|
||||
Some(CollaborationModeInstructions::from_collaboration_mode(&collaboration_mode)?.render())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user