()
| 93 | |
| 94 | #[test] |
| 95 | fn preserves_explicit_host_overrides() { |
| 96 | let def = AgentDefinition::new("planner", "Plan work") |
| 97 | .with_model(ModelConfig { |
| 98 | provider: Some("anthropic".to_string()), |
| 99 | model: "claude-sonnet".to_string(), |
| 100 | }) |
| 101 | .with_prompt("Definition prompt.") |
| 102 | .with_max_steps(3); |
| 103 | let opts = SessionOptions::new() |
| 104 | .with_model("openai/gpt-4o") |
| 105 | .with_max_tool_rounds(12) |
| 106 | .with_prompt_slots(SystemPromptSlots { |
| 107 | role: Some("Host role".to_string()), |
| 108 | extra: Some("Host prompt.".to_string()), |
| 109 | ..SystemPromptSlots::default() |
| 110 | }); |
| 111 | |
| 112 | let opts = apply_agent_definition(opts, &def); |
| 113 | |
| 114 | assert_eq!(opts.model.as_deref(), Some("openai/gpt-4o")); |
| 115 | assert_eq!(opts.max_tool_rounds, Some(12)); |
| 116 | let slots = opts.prompt_slots.unwrap(); |
| 117 | assert_eq!(slots.role.as_deref(), Some("Host role")); |
| 118 | assert_eq!(slots.extra.as_deref(), Some("Host prompt.")); |
| 119 | } |
| 120 | |
| 121 | #[test] |
| 122 | fn defaults_model_provider_when_definition_omits_one() { |
nothing calls this directly
no test coverage detected