Use StartThreadOptions across thread fork APIs (#44043)

## What changed

Pass `StartThreadOptions` through rollout, loaded-history, and prepared forks instead of separate configuration and startup arguments. Replace `options.initial_history` with the fork snapshot while preserving the other supplied startup options, and update app-server and test callers.

Box the app-server's `thread_fork_inner` future to keep the large fork future out of the shared request dispatcher's stack frame.

GitOrigin-RevId: d54eb8b212dedabaf2c5d99d155637cefd7deb7a
This commit is contained in:
vkg-oai authored and copyberry committed 2026-09-09 04:07:40 +00:00
1 parent ec512d2347
commit 283f34387b
14 files changed
+51 -149

No files matched your search

+7 -25
View File
@@ -548,13 +548,7 @@ fn fork_thread_accepts_legacy_usize_snapshot_argument() {
config: Config,
path: std::path::PathBuf,
) {
let _future = manager.fork_thread(
usize::MAX,
config,
path,
/*thread_source*/ None,
/*parent_trace*/ None,
);
let _future = manager.fork_thread(usize::MAX, crate::StartThreadOptions::new(config), path);
}
let _: fn(&ThreadManager, Config, std::path::PathBuf) = assert_legacy_snapshot_callsite;
@@ -1668,10 +1662,8 @@ async fn resume_and_fork_do_not_restore_thread_environments_from_rollout() {
let forked = manager
.fork_thread(
ForkSnapshot::Interrupted,
config,
crate::StartThreadOptions::new(config),
rollout_path,
/*thread_source*/ None,
/*parent_trace*/ None,
)
.await
.expect("fork source thread");
@@ -2098,10 +2090,8 @@ async fn rollout_path_resume_and_fork_read_history_through_thread_store() {
let forked = manager
.fork_thread(
ForkSnapshot::Interrupted,
config,
crate::StartThreadOptions::new(config),
rollout_path,
/*thread_source*/ None,
/*parent_trace*/ None,
)
.await
.expect("fork from rollout path");
@@ -2622,10 +2612,8 @@ async fn interrupted_fork_snapshot_does_not_synthesize_turn_id_for_legacy_histor
let forked = manager
.fork_thread(
ForkSnapshot::Interrupted,
config.clone(),
crate::StartThreadOptions::new(config.clone()),
source_path,
/*thread_source*/ None,
/*parent_trace*/ None,
)
.await
.expect("fork interrupted snapshot");
@@ -2749,10 +2737,8 @@ async fn interrupted_fork_snapshot_preserves_explicit_turn_id() {
let forked = manager
.fork_thread(
ForkSnapshot::Interrupted,
config.clone(),
crate::StartThreadOptions::new(config.clone()),
source_path,
/*thread_source*/ None,
/*parent_trace*/ None,
)
.await
.expect("fork interrupted snapshot");
@@ -2838,10 +2824,8 @@ async fn interrupted_fork_snapshot_uses_persisted_mid_turn_history_without_live_
let forked = manager
.fork_thread(
ForkSnapshot::Interrupted,
config.clone(),
crate::StartThreadOptions::new(config.clone()),
source_path,
/*thread_source*/ None,
/*parent_trace*/ None,
)
.await
.expect("fork interrupted snapshot");
@@ -2879,10 +2863,8 @@ async fn interrupted_fork_snapshot_uses_persisted_mid_turn_history_without_live_
let reforked = manager
.fork_thread(
ForkSnapshot::Interrupted,
config.clone(),
crate::StartThreadOptions::new(config.clone()),
forked_path,
/*thread_source*/ None,
/*parent_trace*/ None,
)
.await
.expect("re-fork interrupted snapshot");