Test the window loop, the window starts, --item and the tmux effects in process; drop the Ctrl-C check every stop's reason already makes

This commit is contained in:
2026-11-16 12:12:18 +01:00
parent 4e02971bfe
commit f3eaf19f62
4 changed files with 196 additions and 6 deletions
+3 -3
View File
@@ -37,8 +37,8 @@ def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
raise
if stop.reason:
say(stop.reason, effects, stdout=not stop.code)
# Every stop with a reason, but the human's own Ctrl-C and the help, is DMed where the project's config can be read and sets `env-file`, so a loop left overnight never ends unseen. A loop given no task prints the help. One that started the project's windows, or whose chunk finished and handed on to the next, stops without a reason: the project's chunks go on.
if stop.code != 130 and stop.reason not in ("", HELP):
# Every stop with a reason, but the help, is DMed where the project's config can be read and sets `env-file`, so a loop left overnight never ends unseen. A loop given no task prints the help. Ctrl-C stops without a reason. So does a loop that started the project's windows, or whose chunk finished and handed on to the next, since the project's chunks go on.
if stop.reason not in ("", HELP):
tell(f"loop-claude in {cwd} stopped: {stop.reason}", effects)
return stop.code
@@ -140,7 +140,7 @@ def own_ladder(file: pathlib.Path, model: str, unrouted: bool) -> str:
def loop_run_from(argv: list[str], cwd: pathlib.Path, effects: Effects) -> LoopRun | Stop:
if argv[:1] != [RELOAD_FLAG]:
chunk, words = (argv[1], argv[2:]) if len(argv) > 2 and argv[0] == CHUNK_FLAG else (None, argv)
chunk, words = (argv[1], argv[2:]) if len(argv) >= 2 and argv[0] == CHUNK_FLAG else (None, argv)
task = " ".join(words)
if task in ("", "-h", "--help"):
return Stop(0 if task else 1, HELP)