Say the reload cannot read the loop's state in one wording across the message, --help and the changelog
This commit was merged in pull request #56.
This commit is contained in:
+5
-5
@@ -10,10 +10,10 @@ interrupt: `claude --resume` on the terminal, every worktree first marked truste
|
||||
An unfinished chunk resumes the same session next cycle; a finished one starts a fresh session.
|
||||
Cycles continue until that interrupt or Ctrl-C. Words: ~/.claude/CLAUDE.md → "Vocabulary".
|
||||
|
||||
Exit 1: no task, not inside a checkout, no premises, claude leaves no transcript, a reload whose
|
||||
state it cannot read, or the worker or the judge fails three times running. A worker fails when
|
||||
claude exits non-zero, is killed, or ends without a result event; a judge when its verdict misses a
|
||||
field or quotes nothing in the transcript.
|
||||
Exit 1: no task, not inside a checkout, no premises, claude leaves no transcript, a reload with
|
||||
unreadable state, or the worker or the judge fails three times running. A worker fails when claude
|
||||
exits non-zero, is killed, or ends without a result event; a judge when its verdict misses a field
|
||||
or quotes nothing in the transcript.
|
||||
Exit 2: the human is needed and stdin or stdout is not a terminal, or the interrupt ended without
|
||||
them typing anything. Rerunning resumes any open session.
|
||||
|
||||
@@ -381,7 +381,7 @@ def reload_if_edited(root, task, cycle_number, failures):
|
||||
def reloaded_state(handed):
|
||||
state = parse(handed[0]) if len(handed) == 1 else None
|
||||
if not state or {"cycle_number", "failures", "root"} - state.keys() or not isinstance(state.get("task"), str) or not state["task"]:
|
||||
sys.exit(f"the reload handed {handed}, not the loop's state with a task; rerun loop-claude <task>")
|
||||
sys.exit(f"the reload cannot read the loop's state from {handed}; rerun loop-claude <task>")
|
||||
return state
|
||||
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ class Main(unittest.TestCase):
|
||||
for handed in (["3", "2", "/r", "do it"], ["3"], ["[1]"], [json.dumps({"cycle_number": 3, "failures": 0, "root": "/r"})], [json.dumps({"cycle_number": 3, "failures": 0, "root": "/r", "task": ""})]):
|
||||
with self.subTest(handed=handed), unittest.mock.patch.object(sys, "argv", ["loop-claude", loop.RELOAD_FLAG, *handed]), self.assertRaises(SystemExit) as stopped:
|
||||
loop.main()
|
||||
self.assertEqual(stopped.exception.code, f"the reload handed {handed}, not the loop's state with a task; rerun loop-claude <task>")
|
||||
self.assertEqual(stopped.exception.code, f"the reload cannot read the loop's state from {handed}; rerun loop-claude <task>")
|
||||
|
||||
def test_resumes_the_root_and_counters_a_reload_handed_over(self):
|
||||
patches = [unittest.mock.patch.object(loop, name) for name in ("checkout_root", "read_premises", "reload_if_edited", "run_cycle")]
|
||||
|
||||
Reference in New Issue
Block a user