(agent: &Agent, opts: SessionOptions)
| 21 | use super::session_runtime::{build_session_runtime, SessionRuntimeInput}; |
| 22 | |
| 23 | pub(super) fn prepare_session_options(agent: &Agent, opts: SessionOptions) -> SessionOptions { |
| 24 | let mut opts = merge_mcp_managers(agent, opts); |
| 25 | if opts.session_id.is_none() { |
| 26 | // Use the host-provided ID generator if one was supplied via |
| 27 | // SessionOptions — this is the entry point that enables |
| 28 | // deterministic-replay tooling to pin session ids. |
| 29 | let env = opts |
| 30 | .host_env |
| 31 | .clone() |
| 32 | .unwrap_or_else(|| Arc::clone(&agent.config.host_env)); |
| 33 | opts.session_id = Some(env.next_id()); |
| 34 | } |
| 35 | opts |
| 36 | } |
| 37 | |
| 38 | fn merge_mcp_managers(agent: &Agent, opts: SessionOptions) -> SessionOptions { |
| 39 | match (&agent.global_mcp, &opts.mcp_manager) { |
no test coverage detected