diff --git a/crates/tinyinference-llm/src/prompt_tools/mod.rs b/crates/tinyinference-llm/src/prompt_tools/mod.rs index 358af54a..08ca0542 100644 --- a/crates/tinyinference-llm/src/prompt_tools/mod.rs +++ b/crates/tinyinference-llm/src/prompt_tools/mod.rs @@ -232,8 +232,10 @@ pub fn ensure_resolvable_user_turn(messages: &[Message]) -> Vec { /// Keep the active request at the end of a prompt-guided tool continuation. /// Some chat templates treat the synthetic tool-result user turn as transport /// data and resolve an earlier user message as the query. Repeating the latest -/// real text request after a terminal result gives those templates the correct -/// query without changing the durable transcript. +/// real text request alongside a terminal result gives those templates the +/// correct query without changing the durable transcript. Both belong in one +/// user turn: a separate trailing request makes a model restart discovery and +/// ignore the result it just received. #[must_use] pub fn anchor_user_request_after_tool_result(messages: &[Message]) -> Vec { if !messages.last().is_some_and(|message| { @@ -258,9 +260,19 @@ pub fn anchor_user_request_after_tool_result(messages: &[Message]) -> Vec