use std::collections::BTreeSet;
#[derive(Debug, Clone, Default)]
pub struct ChildConfig {
pub system_prompt: Option<String>,
pub tool_names: Option<BTreeSet<String>>,
pub max_turns: Option<u32>,
pub context_window: Option<usize>,
pub full_permission: Option<bool>,
pub model: Option<String>,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn default_inherits_everything() {
let c = ChildConfig::default();
assert!(c.system_prompt.is_none());
assert!(c.tool_names.is_none());
assert!(c.max_turns.is_none());
assert!(c.context_window.is_none());
assert!(c.full_permission.is_none());
assert!(c.model.is_none());
}
#[test]
fn clone_is_deep_and_independent() {
let c = ChildConfig {
tool_names: Some(BTreeSet::from(["read_file".to_string()])),
..Default::default()
};
let c2 = c.clone();
assert_eq!(c2.tool_names.as_ref().unwrap().len(), 1);
drop(c);
assert!(c2.tool_names.is_some());
}
}