fix(ralph-loop): commit iteration only after verification continuation dispatches

Split the verification-failure restart into clearVerificationState (clears\nthe verification flags so we cleanly transition back to the main loop)\nfollowed by injectContinuationPrompt, with incrementIteration only on\nsuccessful injection. On rejection: clear the loop state and emit a loud\nwarning toast. Mirrors the dispatch-before-commit contract enforced for\nthe idle and session.error paths.
This commit is contained in:
YeonGyu-Kim
2026-05-11 12:46:35 +09:00
parent 09c45c3acb
commit caaae19155
3 changed files with 68 additions and 9 deletions
@@ -82,6 +82,9 @@ async function detectOracleVerificationFromParentSession(
type LoopStateController = {
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null
clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null
incrementIteration: () => RalphLoopState | null
clear: () => boolean
setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null
}