Name the driver of a cycle in the text its worker, judge and human read

This commit is contained in:
2026-11-18 20:34:40 +01:00
parent b827986ec8
commit c4d06c55b5
15 changed files with 213 additions and 169 deletions
+4 -3
View File
@@ -4,7 +4,7 @@ import typing
@dataclasses.dataclass(frozen=True)
class Stop:
"""loop-claude exits with code, printing reason."""
"""The entry point exits with code, printing reason."""
code: typing.Literal[0, 1, 2, 130]
reason: str
@@ -13,7 +13,8 @@ def needs_human(need: str, blocker: str) -> Stop:
return Stop(2, f"the human is needed to {need}, but {blocker}")
def needs_terminal(need: str, on_terminal: bool) -> Stop | None:
def needs_terminal(need: str, on_terminal: bool, driver: str) -> Stop | None:
"""driver is the entry point the human reruns, such as `do-epic`."""
if on_terminal:
return None
return needs_human(need, "stdin or stdout is not a terminal; rerun loop-claude on a terminal")
return needs_human(need, f"stdin or stdout is not a terminal; rerun {driver} on a terminal")