Add fork snapshot modes (#15239)

## Summary
- add `ForkSnapshotMode` to `ThreadManager::fork_thread` so callers can
request either a committed snapshot or an interrupted snapshot
- share the model-visible `<turn_aborted>` history marker between the
live interrupt path and interrupted forks
- update the small set of direct fork callsites to pass
`ForkSnapshotMode::Committed`

Note: this enables /btw to work similarly as Esc to interrupt (hopefully
somewhat in distribution)

---------

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Charley CunninghamandCodex authored and GitHub committed 2026-03-23 19:05:42 -07:00
1 parent 84fb180eeb
commit f547b79bd0
15 files changed
+823 -52

No files matched your search

+3 -2
View File
@@ -57,6 +57,7 @@ use codex_app_server_protocol::RequestId;
use codex_arg0::Arg0DispatchPaths;
use codex_core::AuthManager;
use codex_core::CodexAuth;
use codex_core::ForkSnapshot;
use codex_core::ThreadManager;
use codex_core::config::Config;
use codex_core::config::ConfigBuilder;
@@ -2502,7 +2503,7 @@ impl App {
);
let forked = thread_manager
.fork_thread(
usize::MAX,
ForkSnapshot::Interrupted,
config.clone(),
target_session.path.clone(),
/*persist_extended_history*/ false,
@@ -2925,7 +2926,7 @@ impl App {
match self
.server
.fork_thread(
usize::MAX,
ForkSnapshot::Interrupted,
self.config.clone(),
path.clone(),
/*persist_extended_history*/ false,