mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
Allow root turn suspension with live descendants (#54414)
## Why Live descendants previously blocked suspension of an unfinished root turn, requiring callers to stop and unload them before recovering the root elsewhere. ## What changed Allow `suspend_turn_and_shutdown` to suspend the root and initiate shutdown of all sessions sharing its local agent runtime, fencing new starts. Remove `SuspendTurnOutcome::HasLiveDescendants`. Success confirms that the root has stopped and its history writer is flushed and closed; descendant cleanup completes separately. Callers must finish tree shutdown or fence and terminate the tree's persistence writers before transferring ownership. Interrupted descendants are not automatically recovered. ## Testing Extend integration coverage to verify child shutdown, recovery under the original root turn ID without restarting children, and separate reporting of child writer failures. GitOrigin-RevId: 5adc240ae6e34654209154ee9324621a2bd604d5
This commit is contained in:
@@ -19,12 +19,8 @@ use ts_rs::TS;
|
||||
/// Result of stopping an unfinished root turn so another worker can recover it.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum SuspendTurnOutcome {
|
||||
Suspended {
|
||||
turn_id: String,
|
||||
},
|
||||
Suspended { turn_id: String },
|
||||
NotActive,
|
||||
/// A currently loaded descendant would remain running after root handoff.
|
||||
HasLiveDescendants,
|
||||
UnsupportedTask,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user