pub fn build_chat_request(
model: impl Into<String>,
model_provider: impl Into<String>,
system_prompt: Option<String>,
messages: Vec<ChatMessage>,
tools: Vec<Value>,
reasoning_effort: Option<String>,
) -> ChatRequestExpand description
Build a ChatRequest from already-assembled prompt + history. The
function is pure and deterministic: same inputs → same JSON bytes. Both
the TUI engine (handle_deepseek_turn / refresh_system_prompt) and
the headless exec call this, so the parity invariant is structural,
not best-effort.