v1.0.5
Install:
pi install git:github.com/edxeth/pi-ralph-loop@v1.0.5Or latest:
pi install git:github.com/edxeth/pi-ralph-loop🐛 Bug Fixes
/ralph-resume no longer restarts the current unit of work
Refs: 0647d5b
Resuming from the same Pi session that owns the saved iteration used to re-send the full task prompt. Because that prompt tells the agent to pick an unfinished item and start working, the agent would begin a brand new unit instead of continuing the one in progress.
Resume now adapts to where it runs. From the session that owns the saved iteration, it reads the last assistant turn instead of re-seeding: an already-emitted COMPLETE or STOP ends the loop, NEXT advances to a fresh iteration, and if no promise was emitted yet it nudges continue so the agent finishes the current unit. From any other session, it still restarts the saved iteration in a fresh session. The seed prompt is now delivered exactly once per session.
Provider retries are no longer cut off as a dead loop
Refs: 75238f2
When a retryable provider error hit (such as a dropped WebSocket), Pi auto-retries with exponential backoff and stays idle between attempts. The loop treated that idleness as a stalled run and finalized with stop_reason: "error" inside Pi's first backoff window, before the first retry even started. A retry that later succeeded was ignored because the loop had already stopped.
The loop now waits out a fixed window (180s, well above Pi's max per-attempt backoff) after a provider-error turn before declaring the loop dead. Any later turn, whether a recovered success or a fresh failure, supersedes the pending wait, so a genuine retry is honored even when it does not advance the iteration.
♻️ Refactoring
Internal restructuring of the loop core and state modules
Refs: 1ca5ab2
Consolidated repeated structures with no change to observable behavior: state read/write now run off a single ordered schema descriptor, terminal-state writes route through one finalizeLoop path, and loop-engine was split into focused helpers (provider-wait, limit-reminders, idle, snapshot-store), dropping it from 592 to about 440 lines. Verified with a clean tsc, 74 passing unit tests, and 5 live Pi RPC tests.