mirror of
https://github.com/openai/codex.git
synced 2026-11-13 22:47:20 +00:00
Record realtime close marker on replacement (#13058)
## Summary - record a realtime close developer message when a new realtime session replaces an active one - assert the replacement marker through the mocked responses request path --------- Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Charles Cunningham <ccunningham@openai.com>
This commit is contained in:
27 files changed
+1292
-214
No files matched your search
@@ -5,6 +5,7 @@ use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
use tokio::task::JoinHandle;
|
||||
|
||||
use crate::codex::PreviousTurnSettings;
|
||||
use crate::codex::SessionConfiguration;
|
||||
use crate::context_manager::ContextManager;
|
||||
use crate::error::Result as CodexResult;
|
||||
@@ -23,10 +24,10 @@ pub(crate) struct SessionState {
|
||||
pub(crate) server_reasoning_included: bool,
|
||||
pub(crate) dependency_env: HashMap<String, String>,
|
||||
pub(crate) mcp_dependency_prompted: HashSet<String>,
|
||||
/// Model used by the latest regular user turn, used for model-switch handling
|
||||
/// on subsequent regular turns (including full-context reinjection after
|
||||
/// resume or `/compact`).
|
||||
previous_model: Option<String>,
|
||||
/// Settings used by the latest regular user turn, used for turn-to-turn
|
||||
/// model/realtime handling on subsequent regular turns (including full-context
|
||||
/// reinjection after resume or `/compact`).
|
||||
previous_turn_settings: Option<PreviousTurnSettings>,
|
||||
/// Startup regular task pre-created during session initialization.
|
||||
pub(crate) startup_regular_task: Option<JoinHandle<CodexResult<RegularTask>>>,
|
||||
pub(crate) active_mcp_tool_selection: Option<Vec<String>>,
|
||||
@@ -44,7 +45,7 @@ impl SessionState {
|
||||
server_reasoning_included: false,
|
||||
dependency_env: HashMap::new(),
|
||||
mcp_dependency_prompted: HashSet::new(),
|
||||
previous_model: None,
|
||||
previous_turn_settings: None,
|
||||
startup_regular_task: None,
|
||||
active_mcp_tool_selection: None,
|
||||
active_connector_selection: HashSet::new(),
|
||||
@@ -60,11 +61,14 @@ impl SessionState {
|
||||
self.history.record_items(items, policy);
|
||||
}
|
||||
|
||||
pub(crate) fn previous_model(&self) -> Option<String> {
|
||||
self.previous_model.clone()
|
||||
pub(crate) fn previous_turn_settings(&self) -> Option<PreviousTurnSettings> {
|
||||
self.previous_turn_settings.clone()
|
||||
}
|
||||
pub(crate) fn set_previous_model(&mut self, previous_model: Option<String>) {
|
||||
self.previous_model = previous_model;
|
||||
pub(crate) fn set_previous_turn_settings(
|
||||
&mut self,
|
||||
previous_turn_settings: Option<PreviousTurnSettings>,
|
||||
) {
|
||||
self.previous_turn_settings = previous_turn_settings;
|
||||
}
|
||||
|
||||
pub(crate) fn clone_history(&self) -> ContextManager {
|
||||
|
||||
Reference in new issue
Block a user