mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Keep interrupts responsive during host service-tier updates (#60644)
## Why Waiting for host acceptance of a service-tier update in the submission loop can block interrupts while the host receipt is pending. ## What changed Move the host acceptance wait out of the submission loop while keeping explicit thread settings replies pending until acceptance completes. Report handoff failures to the caller while preserving the locally committed settings, and allow a subsequent explicit request for the same tier to retry a failed handoff. ## Testing Add a WebSocket regression test covering interrupts with pending host receipts, failure reporting, same-tier retries, and continued thread operation after startup caller cancellation. GitOrigin-RevId: 1b27d156eba3ebb47e717a987f41f4f595635be8
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
//! with checkpoints written directly to storage.
|
||||
|
||||
use super::session::Session;
|
||||
use super::session::SessionSettingsCommit;
|
||||
use super::session::SessionSettingsUpdate;
|
||||
use super::step_settings::StepSettingsUpdate;
|
||||
use crate::WithTurnExtensionData;
|
||||
@@ -77,8 +78,10 @@ impl Session {
|
||||
pub(super) async fn update(
|
||||
session: &Session,
|
||||
overrides: impl Into<WithTurnExtensionData<ThreadSettingsOverrides>>,
|
||||
) -> ConstraintResult<ThreadSettingsSnapshot> {
|
||||
let updates = prepare_update(overrides, &session.services.selected_capability_roots);
|
||||
reply_requested: bool,
|
||||
) -> ConstraintResult<SessionSettingsCommit> {
|
||||
let mut updates = prepare_update(overrides, &session.services.selected_capability_roots);
|
||||
updates.host_acceptance_in_reply = reply_requested;
|
||||
let commit = session.update_settings(updates).await?;
|
||||
let active_turn = session.active_turn.lock().await;
|
||||
// A registered running task retains its lineage so it can be recovered after a daemon
|
||||
@@ -89,7 +92,7 @@ pub(super) async fn update(
|
||||
{
|
||||
session.state.lock().await.last_started_turn_id = None;
|
||||
}
|
||||
Ok(commit.snapshot)
|
||||
Ok(commit)
|
||||
}
|
||||
|
||||
/// Converts protocol overrides into the internal settings update shape.
|
||||
|
||||
Reference in New Issue
Block a user