Ralph Loop accepts an untagged response as a completion promise
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
Direzione di ricerca
Inizia con ralph-loop/hooks/capture-response.sh e riproduci l’estrazione Perl documentata con risposte contrassegnate, non contrassegnate, vuote e malformate. Controlla i confronti correlati e la gestione del flag Done in ralph-loop/hooks/stop-hook.sh. Done significa che solo le promesse complete e contrassegnate possono creare il flag, mantenendo la normalizzazione degli spazi bianchi, e che i test coprono i casi contrassegnati e non contrassegnati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
ralph-loop/hooks/capture-response.sh is intended to recognize a completion promise only when an assistant response contains:
<promise>EXPECTED TEXT</promise>
The current Perl expression uses -p:
PROMISE_TEXT=$(echo "$RESPONSE_TEXT" | perl -0777 -pe 's/.*?<promise>(.*?)<\/promise>.*/$1/s; s/^\s+|\s+$//g; s/\s+/ /g' 2>/dev/null || echo "")
Perl's -p mode prints the pattern space even when the <promise> substitution does not match. Consequently, an untagged response is returned as PROMISE_TEXT after whitespace normalization.
If that response exactly matches the configured completion promise, the hook creates .cursor/ralph/done. The stop hook then treats the loop as complete and terminates it, even though the required <promise> tag was absent.
Affected files
ralph-loop/hooks/capture-response.sh, lines 39–44ralph-loop/hooks/stop-hook.sh, lines 43–48 and 73–77
Steps to reproduce
Run the current extraction expression with an untagged response:
printf '%s' 'ALL TESTS PASS' | \
perl -0777 -pe 's/.*?<promise>(.*?)<\/promise>.*/$1/s; s/^\s+|\s+$//g; s/\s+/ /g'
Actual output:
ALL TESTS PASS
In an active Ralph Loop whose configured completion promise is ALL TESTS PASS, this untagged response satisfies the equality check and creates the done flag.
Expected behavior
When the response does not contain a complete <promise>...</promise> element, PROMISE_TEXT should be empty and the done flag should not be created.
Actual behavior
An untagged response is treated as the extracted promise text and can prematurely complete the loop when it equals the configured promise.
Proposed fix
Use non-printing mode and print only after an explicit tag match:
PROMISE_TEXT=$(echo "$RESPONSE_TEXT" | perl -0777 -ne '
if (/<promise>(.*?)<\/promise>/s) {
my $p = $1;
$p =~ s/^\s+|\s+$//g;
$p =~ s/\s+/ /g;
print $p;
}
' 2>/dev/null || echo "")
Acceptance criteria
- An untagged response that equals the configured completion promise does not create the done flag.
- A correctly tagged promise still creates the done flag.
- Whitespace inside a tagged promise continues to be normalized before comparison.
- Empty, malformed, or partially closed promise tags do not complete the loop.
- Tests cover both tagged and untagged responses.
- Lingua principale
- TypeScript
- Stelle
- 8.2k
- Fork
- 751
- Merge medio
- 12h 1m
- PR unite (30g)
- 43
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cursor/plugins
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
pstack: disable-model-invocation skills still have "Use only when user ..." agent instructions Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Zoom connector Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di cursor/plugins
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
fullcalendar/fullcalendar#8106 ·