fix(ralph-loop): abort stale Oracle sessions before ulw verification restart

When Oracle verification fails in ulw-loop mode, the previous Oracle
session was never aborted before restarting. Each retry created a new
descendant session, causing unbounded session accumulation and 500
errors from server overload.

Now abort the old verification session before:
- restarting the loop after failed verification
- re-entering verification phase on subsequent DONE detection
This commit is contained in:
YeonGyu-Kim
2026-03-18 12:49:27 +09:00
parent 55ac653eaa
commit 3caae14192
3 changed files with 106 additions and 0 deletions
@@ -68,6 +68,10 @@ export async function handleFailedVerification(
return false
}
if (state.verification_session_id) {
ctx.client.session.abort({ path: { id: state.verification_session_id } }).catch(() => {})
}
const resumedState = loopState.restartAfterFailedVerification(
parentSessionID,
messageCountAtStart,