const FINISHED_ESCAPE: &str = " If the work is genuinely done and you have already reported it, \
reply with a short confirmation and stop; do not run extra tool calls to re-verify it.";
const NO_EXECUTION_WHILE_REASONING: &str = "Tools execute only between turns; nothing runs inside your reasoning. If you saw that \
output while thinking, you imagined it. The only evidence a tool ran is its result \
present in this conversation.";
pub fn uncalled_commands_nudge(commands: &[String]) -> String {
let quoted = commands
.iter()
.map(|c| format!("`{c}`"))
.collect::<Vec<_>>()
.join(", ");
let subject = if commands.len() == 1 {
"output from"
} else {
"output from these commands:"
};
format!(
"[System: You reported {subject} {quoted}. No such call ran this turn. \
{NO_EXECUTION_WHILE_REASONING} Call the tool now through the structured tool-call API, \
or retract the claim and tell the user it has not been run.{FINISHED_ESCAPE}]"
)
}
pub fn no_tool_calls_nudge(local_model: bool) -> String {
let channel = if local_model {
"Invoke it through the provider's structured tool-call API, the same channel the function \
schemas were registered on. JSON or markdown written into your message is text and does \
not execute."
} else {
"Call the tool through the structured tool-call API rather than describing it."
};
format!(
"[System: Your last response claimed work but produced no tool calls, so nothing was \
executed. {NO_EXECUTION_WHILE_REASONING} {channel} Pick the tool you need and call it \
now.{FINISHED_ESCAPE}]"
)
}