pub fn resolve_model(
agent_config: &AgentConfig,
run_context: Option<&RunContext>,
) -> StringExpand description
Resolve the model slug for an invocation.
Why: Centralises the precedence so per-call overrides, per-agent config, and
the global default never disagree across call sites.
What: Returns, in priority order, the first non-empty of:
(1) run_context.model (per-call override),
(2) agent_config.agent.model,
(3) agent_config.llm.model_override,
else (4) DEFAULT_MODEL — each candidate passed through
[normalize_model_alias] (#3438) so a bare opus/sonnet/haiku alias
never reaches a provider as-is.
Test: routing::tests::resolve_model_* cover every tier;
routing::tests::resolve_model_normalizes_short_alias_from_agent_config
and resolve_model_normalizes_short_alias_from_run_context cover #3438.