diff --git a/scripts/ollama-tool-proxy.py b/scripts/ollama-tool-proxy.py index 3c27e23..3c3b85d 100644 --- a/scripts/ollama-tool-proxy.py +++ b/scripts/ollama-tool-proxy.py @@ -178,6 +178,10 @@ def complete(request, bash_mode): "Otherwise state what evidence is missing. Do not repeat the PVC or PV lookup."}] retried = translate(query_ollama(retry), request["tools"]) print("resource_decision_retry", "tool_call=" + str(bool(retried["choices"][0]["message"].get("tool_calls"))), flush=True) + if same_as_last_call(retried["choices"][0]["message"], messages): + retried["choices"][0]["message"] = {"role": "assistant", "content": + "JEANNIE_STOP_REPEATED_TOOL_CALL: Holmes repeated the preceding command; investigation is incomplete."} + retried["choices"][0]["finish_reason"] = "stop" return retried next_check = ("The PVC was already inspected. Check the bound PV by its actual PV name; use kubectl get pv, not get pvc. " if re.search(r"\bget\s+(?:pvc|persistentvolumeclaim)\b", previous) else