Add session forking capability (#5882)
Co-authored-by: Zane Staggs <zane@squareup.com>
This commit is contained in:
@@ -1285,14 +1285,23 @@ impl SessionStorage {
|
||||
)
|
||||
.await?;
|
||||
|
||||
session_manager
|
||||
let mut builder = session_manager
|
||||
.update(&new_session.id)
|
||||
.extension_data(original_session.extension_data)
|
||||
.schedule_id(original_session.schedule_id)
|
||||
.recipe(original_session.recipe)
|
||||
.user_recipe_values(original_session.user_recipe_values)
|
||||
.apply()
|
||||
.await?;
|
||||
.user_recipe_values(original_session.user_recipe_values);
|
||||
|
||||
// Preserve provider and model config from original session
|
||||
if let Some(provider_name) = original_session.provider_name {
|
||||
builder = builder.provider_name(provider_name);
|
||||
}
|
||||
|
||||
if let Some(model_config) = original_session.model_config {
|
||||
builder = builder.model_config(model_config);
|
||||
}
|
||||
|
||||
builder.apply().await?;
|
||||
|
||||
if let Some(conversation) = original_session.conversation {
|
||||
self.replace_conversation(&new_session.id, &conversation)
|
||||
|
||||
Reference in New Issue
Block a user