mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 15:15:57 +03:00
[PR #140] [CLOSED] Fix completion promise false positives #158
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/140
Author: @douglaz
Created: 1/31/2026
Status: ❌ Closed
Base:
main← Head:fix/completion-promise-detection📝 Commits (2)
d397c34Fix completion promise false positives4036544Clarify and harden completion detection📊 Changes
2 files changed (+97 additions, -2 deletions)
View changed files
📝
crates/ralph-cli/src/loop_runner.rs(+88 -2)📝
crates/ralph-core/src/event_parser.rs(+9 -0)📄 Description
Fixes https://github.com/mikeyobrien/ralph-orchestrator/issues/139
Problem
Some backends (notably Codex) echo the full prompt back in their transcript. The prompt itself includes Ralph instructions that mention the completion promise token (e.g.
LOOP_COMPLETE).Ralph was checking completion by doing a substring match against the raw backend output. That caused false positives:
direction.setcould terminate immediately because the echoed prompt containedLOOP_COMPLETE.--completion-promise ""effectively enabled immediate completion becausestr::contains("")is always true.Solution
EventParser::contains_promise.usermarker). This keeps the behavior conservative and avoids stripping legitimate assistant text.Tests
cargo test -p ralph-core event_parser --quietcargo test -p ralph-cli loop_runner --quiet🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.