fix(ralph-loop): remove dead semantic completion fallback
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -31,20 +31,6 @@ function buildPromisePattern(promise: string): RegExp {
|
||||
return new RegExp(`<promise>\\s*${escapeRegex(promise)}\\s*</promise>`, "is")
|
||||
}
|
||||
|
||||
const SEMANTIC_COMPLETION_PATTERNS = [
|
||||
/\b(?:task|work|implementation|all\s+tasks?)\s+(?:is|are)\s+(?:complete|completed|done|finished)\b/i,
|
||||
/\ball\s+(?:items?|todos?|steps?)\s+(?:are\s+)?(?:complete|completed|done|finished|marked)\b/i,
|
||||
/\b(?:everything|all\s+work)\s+(?:is\s+)?(?:complete|completed|done|finished)\b/i,
|
||||
/\bsuccessfully\s+completed?\s+all\b/i,
|
||||
/\bnothing\s+(?:left|more|remaining)\s+to\s+(?:do|implement|fix)\b/i,
|
||||
]
|
||||
|
||||
const SEMANTIC_DONE_FALLBACK_ENABLED = false
|
||||
|
||||
export function detectSemanticCompletion(text: string): boolean {
|
||||
return SEMANTIC_COMPLETION_PATTERNS.some((pattern) => pattern.test(text))
|
||||
}
|
||||
|
||||
export function detectCompletionInTranscript(
|
||||
transcriptPath: string | undefined,
|
||||
promise: string,
|
||||
@@ -57,7 +43,7 @@ export function detectCompletionInTranscript(
|
||||
|
||||
const content = readFileSync(transcriptPath, "utf-8")
|
||||
const pattern = buildPromisePattern(promise)
|
||||
const lines = content.split("\n").filter((line) => line.trim())
|
||||
const lines = content.split("\n").filter((line: string) => line.trim())
|
||||
|
||||
for (const line of lines) {
|
||||
try {
|
||||
@@ -68,11 +54,6 @@ export function detectCompletionInTranscript(
|
||||
const entryText = extractTranscriptEntryText(entry)
|
||||
if (!entryText) continue
|
||||
if (pattern.test(entryText)) return true
|
||||
const isAssistantEntry = entry.type === "assistant" || entry.type === "text"
|
||||
if (SEMANTIC_DONE_FALLBACK_ENABLED && promise === "DONE" && isAssistantEntry && detectSemanticCompletion(entryText)) {
|
||||
log("[ralph-loop] WARNING: Semantic completion detected in transcript (agent used natural language instead of <promise>DONE</promise>)")
|
||||
return true
|
||||
}
|
||||
} catch {
|
||||
continue
|
||||
}
|
||||
@@ -136,13 +117,6 @@ export async function detectCompletionInSessionMessages(
|
||||
if (pattern.test(responseText)) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (SEMANTIC_DONE_FALLBACK_ENABLED && options.promise === "DONE" && detectSemanticCompletion(responseText)) {
|
||||
log("[ralph-loop] WARNING: Semantic completion detected (agent used natural language instead of <promise>DONE</promise>)", {
|
||||
sessionID: options.sessionID,
|
||||
})
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user