Summary
When ralphex plan mode hits an authorization error mid-run, it writes a terminal Completed... line to the progress file and exits. Restarting the same prompt
then treats the run as already finished and overwrites the progress file from scratch, losing all accumulated progress.
Steps to reproduce
- Start
ralphex plan mode with a non-trivial prompt.
- Let it run until an authorization error occurs (e.g. token expiry /
401 from the model provider).
- Observe that the progress file now ends with a
Completed... line, even though the run did not actually finish.
- Restart
ralphex with the same prompt.
- Observe that the progress file is reset to empty — prior iterations are gone.
Expected behavior
An authorization error should be treated as a recoverable failure, not a successful completion. On restart with the same prompt, ralphex should resume from
the last real iteration, preserving progress.
Actual behavior
- Auth errors are recorded as
Completed..., indistinguishable from a real successful finish.
- Restart wipes the progress file and starts over from zero.
Workaround
Before restarting, manually remove the trailing Completed... line from the progress file:
Iteration 4: ...
Iteration 5: ...
- Completed...
ralphex then correctly resumes and appends new iterations instead of rewriting the file.
Suggested fix
- Don't emit
Completed... on error exits. Use a distinct terminal marker (e.g. Failed: <reason>) or no terminal marker at all, so restart logic can detect an
incomplete run.
- On restart, detect failure / incomplete states and resume rather than overwrite.
- Optionally, retry transient auth errors with backoff before giving up.
Impact
Any long-running plan that encounters a transient auth error loses all prior work unless the user knows the file-surgery workaround.
Screenshot

Summary
When
ralphexplan mode hits an authorization error mid-run, it writes a terminalCompleted...line to the progress file and exits. Restarting the same promptthen treats the run as already finished and overwrites the progress file from scratch, losing all accumulated progress.
Steps to reproduce
ralphexplan mode with a non-trivial prompt.401from the model provider).Completed...line, even though the run did not actually finish.ralphexwith the same prompt.Expected behavior
An authorization error should be treated as a recoverable failure, not a successful completion. On restart with the same prompt,
ralphexshould resume fromthe last real iteration, preserving progress.
Actual behavior
Completed..., indistinguishable from a real successful finish.Workaround
Before restarting, manually remove the trailing
Completed...line from the progress file:Iteration 4: ... Iteration 5: ... - Completed...ralphexthen correctly resumes and appends new iterations instead of rewriting the file.Suggested fix
Completed...on error exits. Use a distinct terminal marker (e.g.Failed: <reason>) or no terminal marker at all, so restart logic can detect anincomplete run.
Impact
Any long-running plan that encounters a transient auth error loses all prior work unless the user knows the file-surgery workaround.
Screenshot