pub fn decide_role(signals: &RoleSignals<'_>) -> ModelRoleExpand description
Unstable (feature: role-switching) — may change or be removed
Decide the active role from signals, in priority order.
RoleSignals::explicit_override— a user pin always wins.RoleSignals::current_tool— a tool declares its role (e.g.commit→ModelRole::Commit).- long context —
estimated_tokens > long_context_threshold→ModelRole::Slow. RoleSignals::thinking_enabled→ModelRole::Slow.RoleSignals::is_trivial→ModelRole::Smol.- otherwise →
ModelRole::Default.
Long-context and thinking both select Slow (the heavy model) but are
distinct signals: a long context may need a large window even without
extended thinking, and thinking may be on for a short prompt.