From 413aa2f6383763eae0cc08932b43fa931a4a9670 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 26 Sep 2026 19:59:43 +0200 Subject: [PATCH] Pin that one override still asks, and say where the catalog and the entry go --- CHANGELOG.md | 2 +- bin/loop-claude | 4 ++-- bin/test_loop_claude.py | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19040bf1..d1a03830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,6 @@ - `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 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 every claude it starts, the interrupt included, on the project's model, saved in `~/.claude/loop-claude-models.json`. A project without an entry is asked for one on the terminal, from Claude Code's model catalog, and exits 2 without a terminal; delete the entry to pick again. `LOOP_CLAUDE_WORKER_MODEL` and `LOOP_CLAUDE_JUDGE_MODEL` override it. +- `loop-claude` runs every claude it starts, the interrupt included, on the project's model, saved in `~/.claude/loop-claude-models.json`. A project without an entry is asked for one on the terminal, from Claude Code's model catalog, and exits 2 without a terminal; delete the entry to pick again. `LOOP_CLAUDE_WORKER_MODEL` and `LOOP_CLAUDE_JUDGE_MODEL` override it; with both set, nothing is asked. - `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. - `loop-claude`'s no-premises exit names what is wrong: `README.md` unopenable or not UTF-8, a `## Goals` or `## Audience` heading missing or repeated, or nothing under one. diff --git a/bin/loop-claude b/bin/loop-claude index 42a63d0c..f83b2f8c 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -276,14 +276,14 @@ def read_models(saved): def ask_model(name, saved): if not (sys.stdin.isatty() and sys.stdout.isatty()): - print(f"{name} has no model in {saved}, and stdin or stdout is not a terminal to ask on; run it on a terminal or add \"{name}\": \"\" to {saved}", file=sys.stderr) + print(f"{name} has no model in {saved}, and stdin or stdout is not a terminal to ask on; run it on a terminal or add \"{name}\": \"\" to the JSON object in {saved}", file=sys.stderr) sys.exit(2) offered = catalog() print(f"\nThe model to run {name} on, saved in {saved}:", file=sys.stderr) for number, (model_id, label) in enumerate(offered, 1): print(f" {number}. {label} ({model_id})", file=sys.stderr) if not offered: - print(" no model catalog cached; running claude once fills it", file=sys.stderr) + print(" no model catalog cached in ~/.claude/cache/model-catalog", file=sys.stderr) while True: try: answer = input(f"{'A number, or any' if offered else 'A'} name claude --model takes: ").strip() diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index e60e23ad..e300835d 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -158,10 +158,13 @@ class ProjectModel(unittest.TestCase): with unittest.mock.patch("sys.stdin.isatty", return_value=False), self.assertRaises(SystemExit) as stopped: loop.project_model("/srv/a") self.assertEqual(stopped.exception.code, 2) - self.assertIn(f'add "srv/a": "" to {saved}', sys.stderr.getvalue()) + self.assertIn(f'add "srv/a": "" to the JSON object in {saved}', sys.stderr.getvalue()) self.assertFalse(saved.exists()) with unittest.mock.patch.dict(os.environ, {"LOOP_CLAUDE_JUDGE_MODEL": "j", "LOOP_CLAUDE_WORKER_MODEL": "w"}), unittest.mock.patch("sys.stdin.isatty", return_value=False): self.assertEqual(loop.project_model("/srv/a"), "") + with unittest.mock.patch.dict(os.environ, {"LOOP_CLAUDE_JUDGE_MODEL": "j"}), unittest.mock.patch("sys.stdin.isatty", return_value=False), self.assertRaises(SystemExit) as stopped: + loop.project_model("/srv/a") + self.assertEqual(stopped.exception.code, 2) with ( unittest.mock.patch("sys.stdin.isatty", return_value=True), unittest.mock.patch("sys.stdout.isatty", return_value=True),