mirror of
https://github.com/openai/codex.git
synced 2026-11-09 08:40:33 +00:00
Add unfinished root turn suspension (#40038)
## Why An active root turn needs to be stopped without marking it complete or aborted before another runtime can recover the same turn ID. ## What changed - Add `CodexThread::suspend_turn_and_shutdown` and `SuspendTurnOutcome`. - Flush history, stop the active regular task, close the history writer, and shut down the session without recording a terminal turn event. - Reject suspension when no supported turn is active or the loaded agent subtree still contains a live descendant. ## Testing - Verify that suspension preserves unfinished history and allows the turn to be recovered under its original ID after the descendant guard is cleared. GitOrigin-RevId: 1f9b019d07c51474ec2d991d263bc15cdd4f89ad
This commit is contained in:
1 parent
970b7f2ff4
commit
4f39251a01
10 files changed
+345
-3
No files matched your search
@@ -63,7 +63,7 @@ pub(crate) use user_shell::UserShellCommandMode;
|
||||
pub(crate) use user_shell::UserShellCommandTask;
|
||||
pub(crate) use user_shell::execute_user_shell_command;
|
||||
|
||||
const GRACEFULL_INTERRUPTION_TIMEOUT_MS: u64 = 100;
|
||||
pub(crate) const GRACEFULL_INTERRUPTION_TIMEOUT_MS: u64 = 100;
|
||||
const TASK_COMPACT_METRIC: &str = "codex.task.compact";
|
||||
static ACTIVE_TURNS: Gauge = Gauge::new("core.turns.active");
|
||||
|
||||
|
||||
Reference in new issue
Block a user