From 7543f1489ca7f972739b410458612c35031fc825 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 25 Apr 2026 04:11:57 +0530 Subject: [PATCH] Add TASK_FINISHED stop ritual to system prompt Instruct the model to emit exactly one `bash` tool call with `echo "TASK_FINISHED"` when it is confident the fix is complete. This gives the rollout engine an explicit, easy-to-detect termination signal, analogous to mini-swe-agent-plus's MINI_SWE_AGENT_FINAL_OUTPUT. Only appended when `bash` is an active tool, so non-bash configs are unaffected. This prompt change is a no-op without the companion verifiers stop-hook PR that watches for the signal. --- src/rlm/prompt.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/rlm/prompt.py b/src/rlm/prompt.py index d03c0c1..cb7f35f 100644 --- a/src/rlm/prompt.py +++ b/src/rlm/prompt.py @@ -64,4 +64,20 @@ def build_system_prompt( if active_tools: parts.extend(["", "Call at most one built-in tool per turn."]) + active_tool_names = {tool.name for tool in active_tools} + if "bash" in active_tool_names: + parts.extend( + [ + "", + "When you are confident the task is complete and verified, signal the" + " end of the rollout by issuing exactly one `bash` tool call with the" + " command:", + "", + ' echo "TASK_FINISHED"', + "", + "Emit no further tool calls or text after this. You cannot continue" + " working on this task after submitting.", + ] + ) + return "\n".join(parts)