Component: ralph loop stop hook
Symptom
The stop hook greps the agent's output for the completion tag as a plain substring. It cannot distinguish a mention of the tag from a use of it.
Writing the tag in prose — to explain the loop protocol to the user, or to quote the contract in a status report — terminates the loop and deletes the state file, even though no completion was ever signalled.
Impact
A loop can be ended by its own documentation.
The workaround is for the agent to never write the tag in any user-facing text, which makes the protocol impossible to explain in-session. In our runs this became a standing instruction carried across context compactions, purely to avoid tripping the hook by accident.
We hit this for real: a prose mention ended a loop and took the state file with it (see the companion issue on state-file deletion).
Suggested fix
Any one of these removes the ambiguity:
- require the tag to be the sole content of the final output block;
- anchor the match to the end of the message;
- use a delimiter form that prose cannot accidentally contain.
Provenance
Observed during a multi-day ralph run on an external project. Reported with the maintainer's tooling in mind, not as a support request — happy to test a fix.
Component: ralph loop stop hook
Symptom
The stop hook greps the agent's output for the completion tag as a plain substring. It cannot distinguish a mention of the tag from a use of it.
Writing the tag in prose — to explain the loop protocol to the user, or to quote the contract in a status report — terminates the loop and deletes the state file, even though no completion was ever signalled.
Impact
A loop can be ended by its own documentation.
The workaround is for the agent to never write the tag in any user-facing text, which makes the protocol impossible to explain in-session. In our runs this became a standing instruction carried across context compactions, purely to avoid tripping the hook by accident.
We hit this for real: a prose mention ended a loop and took the state file with it (see the companion issue on state-file deletion).
Suggested fix
Any one of these removes the ambiguity:
Provenance
Observed during a multi-day ralph run on an external project. Reported with the maintainer's tooling in mind, not as a support request — happy to test a fix.