Answer stability round 1: 1 🔴, 5 🟡 (0 misread); catch a broken HTTP answer, drop typed keys before the DM, DM every stop but Ctrl-C and a crash, inject home and http, and test the gaps

This commit is contained in:
2026-11-11 22:37:52 +01:00
parent f10170bf8b
commit 23af106b47
11 changed files with 131 additions and 46 deletions
+5 -2
View File
@@ -31,10 +31,13 @@ def main(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launcher:
stop = run_loop(argv, env, paths, launcher, cwd, effects)
except KeyboardInterrupt:
stop = Stop(130, "")
except Exception as crash:
tell(f"loop-claude in {cwd} crashed: {crash!r}", effects)
raise
if stop.reason:
say(stop.reason, effects, stdout=not stop.code)
# Exit 2 is a stop the human chose or must answer at the terminal, and 130 is Ctrl-C; a loop given no task stops before it runs.
if stop.code == 1 and argv:
# Every stop but the human's own Ctrl-C and the help is DMed, so a loop left overnight never ends unseen. A loop given no task prints the help.
if stop.code != 130 and stop.reason != HELP:
tell(f"loop-claude in {cwd} stopped: {stop.reason}", effects)
return stop.code