preserve model-derived instruction provenance

This commit is contained in:
Ahmed Ibrahim
2026-06-09 16:32:01 +00:00
parent b83f7eef6e
commit cd095e5efa
13 changed files with 47 additions and 22 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ impl ThreadStore for InMemoryThreadStore {
source: params.source.clone(),
thread_source: params.thread_source,
model_provider: Some(params.metadata.model_provider.clone()),
base_instructions: Some(params.base_instructions.clone()),
base_instructions: params.base_instructions.clone(),
dynamic_tools: (!params.dynamic_tools.is_empty()).then(|| params.dynamic_tools.clone()),
memory_mode: matches!(params.metadata.memory_mode, ThreadMemoryMode::Disabled)
.then_some("disabled".to_string()),
+1 -1
View File
@@ -1018,7 +1018,7 @@ mod tests {
parent_thread_id: None,
source: SessionSource::Exec,
thread_source: None,
base_instructions: BaseInstructions::default(),
base_instructions: Some(BaseInstructions::default()),
dynamic_tools: Vec::new(),
multi_agent_version: None,
metadata: thread_metadata(),
+5 -2
View File
@@ -75,8 +75,11 @@ pub struct CreateThreadParams {
pub source: SessionSource,
/// Optional analytics source classification for this thread.
pub thread_source: Option<ThreadSource>,
/// Base instructions persisted in session metadata.
pub base_instructions: BaseInstructions,
/// Fixed base instructions persisted in session metadata.
///
/// `None` leaves model-derived instructions unresolved so the current model catalog can rebuild
/// them when the thread is resumed.
pub base_instructions: Option<BaseInstructions>,
/// Dynamic tools available to the thread at startup.
pub dynamic_tools: Vec<DynamicToolSpec>,
/// Multi-agent runtime selected when the thread was created.