mirror of
https://github.com/openai/codex.git
synced 2026-11-22 23:16:05 +00:00
Make automatic turn admission atomic with settings updates (#40648)
## Why Turn settings can change after an input request previews its overrides. Automatic idle work could therefore make a Plan-mode admission decision from stale settings or apply a sparse override built from an outdated collaboration mode. ## What changed - Evaluate automatic turn admission against both the current and proposed configuration under the settings publication lock. - Reject automatic work that would enter or leave Plan mode without committing settings or triggering runtime configuration effects. - Keep model and reasoning-effort overrides sparse until they are merged with the configuration being committed. - Continue allowing explicit user and recovery turns to make valid mode transitions. ## Testing Add coverage for concurrent settings changes, sparse model and effort updates, commit-time constraint validation, atomic Plan-mode rejection, and subsequent explicit user submission. GitOrigin-RevId: 234f06de116bdce7c3a3fb5cac3d15583304a253
This commit is contained in:
1 parent
1d64085e67
commit
ba6cf9c692
9 files changed
+756
-137
No files matched your search
@@ -522,7 +522,7 @@ impl CodexThread {
|
||||
&self,
|
||||
overrides: CodexThreadSettingsOverrides,
|
||||
) -> ConstraintResult<ThreadConfigSnapshot> {
|
||||
let updates = self.thread_settings_update(overrides).await;
|
||||
let updates = Self::thread_settings_update(overrides);
|
||||
self.session.preview_settings(&updates).await
|
||||
}
|
||||
|
||||
@@ -534,14 +534,11 @@ impl CodexThread {
|
||||
&self,
|
||||
settings: CodexThreadSettingsOverrides,
|
||||
) -> ConstraintResult<()> {
|
||||
let updates = self.thread_settings_update(settings).await;
|
||||
let updates = Self::thread_settings_update(settings);
|
||||
self.session.update_settings(updates).await.map(|_| ())
|
||||
}
|
||||
|
||||
async fn thread_settings_update(
|
||||
&self,
|
||||
overrides: CodexThreadSettingsOverrides,
|
||||
) -> SessionSettingsUpdate {
|
||||
fn thread_settings_update(overrides: CodexThreadSettingsOverrides) -> SessionSettingsUpdate {
|
||||
let CodexThreadSettingsOverrides {
|
||||
environments,
|
||||
profile_workspace_roots,
|
||||
@@ -558,18 +555,11 @@ impl CodexThread {
|
||||
collaboration_mode,
|
||||
personality,
|
||||
} = overrides;
|
||||
let collaboration_mode = if let Some(collaboration_mode) = collaboration_mode {
|
||||
collaboration_mode
|
||||
} else {
|
||||
self.session
|
||||
.collaboration_mode()
|
||||
.await
|
||||
.with_updates(model, effort, /*developer_instructions*/ None)
|
||||
};
|
||||
|
||||
SessionSettingsUpdate {
|
||||
step_settings: StepSettingsUpdate {
|
||||
collaboration_mode: Some(collaboration_mode),
|
||||
model,
|
||||
effort,
|
||||
collaboration_mode,
|
||||
reasoning_summary: summary,
|
||||
service_tier,
|
||||
personality,
|
||||
|
||||
Reference in new issue
Block a user