From 99dd74c55bca517b48de3e75ad411796c2b14751 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 26 Sep 2026 13:42:32 +0200 Subject: [PATCH] Say the reload cannot read the loop's state in one wording across the message, --help and the changelog --- CHANGELOG.md | 2 +- bin/loop-claude | 10 +++++----- bin/test_loop_claude.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d897379..79fde370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - `loop-claude` archives each session's transcript under `~/.claude/loop-claude-transcripts/`, one folder per project; `LOOP_CLAUDE_TRANSCRIPTS` overrides the root. - `loop-claude` runs at the checkout root wherever inside the checkout it is started. - `loop-claude` says why when it cannot read `~/.claude.json` before an interrupt, and the interrupt then lands in Claude Code's trust dialog. -- `loop-claude` takes an edit to itself at the next cycle boundary once the edited file answers `--help`, and exits 1 naming the reload when the edited file cannot read the running loop's state. +- `loop-claude` takes an edit to itself at the next cycle boundary once the edited file answers `--help`, and exits 1 when the edited file cannot read the running loop's state. - `loop-claude --help` names the Claude Code version its transcript, session and trust handling were observed on; check it first when an upgrade breaks a cycle. - `loop-claude` runs the model each project's settings pick; `LOOP_CLAUDE_WORKER_MODEL` and `LOOP_CLAUDE_JUDGE_MODEL` override it. - `settings.json`, the agents and the status line run on any machine unedited; the status line shows reset times in the machine's own time zone. diff --git a/bin/loop-claude b/bin/loop-claude index bbc72cf6..36b307b3 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -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 ") + sys.exit(f"the reload cannot read the loop's state from {handed}; rerun loop-claude ") return state diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 84d78aa1..a1eb06ec 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -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 ") + self.assertEqual(stopped.exception.code, f"the reload cannot read the loop's state from {handed}; rerun loop-claude ") 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")]