normalize_session_llm_override

Function normalize_session_llm_override 

Source
pub fn normalize_session_llm_override(
    config: &AppConfig,
    session: &mut AgentSession,
    cli_model_arg: Option<&str>,
) -> Result<bool, String>
Expand description

Normalize and (optionally) migrate session-scoped LLM selection state.

This is the core normalization logic — it performs validation and canonicalization but does not produce any user-facing output. Callers (CLI, GUI) are responsible for presenting errors.

Returns:

  • Ok(true) if the session was modified and should be persisted.
  • Ok(false) if no changes were necessary.
  • Err(msg) if validation failed (e.g. incompatible provider/model).