test(ralph-loop): cover non-abort error continuation

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-27 18:22:53 +09:00
parent 2e6b3b7f76
commit 69c37e3965
2 changed files with 102 additions and 5 deletions
+6 -5
View File
@@ -386,8 +386,8 @@ describe("ralph-loop", () => {
expect(hook.getState()).not.toBeNull()
})
test("should skip injection during recovery", async () => {
// given - active loop and session in recovery
test("should continue after non-abort session error", async () => {
// given - active loop and non-abort session error
const hook = createRalphLoopHook(createMockPluginInput())
hook.startLoop("session-123", "Test task")
@@ -398,7 +398,7 @@ describe("ralph-loop", () => {
},
})
// when - session goes idle immediately
// when - session goes idle immediately after the error
await hook.event({
event: {
type: "session.idle",
@@ -406,8 +406,9 @@ describe("ralph-loop", () => {
},
})
// then - no continuation injected
expect(promptCalls.length).toBe(0)
// then - continuation is injected without a recovery skip
expect(promptCalls.length).toBe(1)
expect(hook.getState()?.iteration).toBe(2)
})
test("should clear state on session deletion", async () => {