Name human_needed.py for the exit-2 stops it holds

This commit was merged in pull request #126.
This commit is contained in:
2026-09-29 10:41:11 +02:00
parent f602b94aff
commit 2f9ab2fb7d
4 changed files with 8 additions and 9 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import subprocess
import sys
from loop_claude import human
from loop_claude import human_needed
from loop_claude.claude_code.transcript import human_turns, read
from loop_claude.claude_code.trust import trust
from loop_claude.outcome import Failure, Stop
@@ -12,7 +12,7 @@ TO = "answer the question above"
def interrupt(root, session_id, model, path, question, paths):
print(f"\n{question}", file=sys.stderr)
if stop := human.off_terminal(TO):
if stop := human_needed.off_terminal(TO):
return stop
trust(paths.claude_json, checkouts(root))
entries = read(path)
@@ -27,5 +27,5 @@ def interrupt(root, session_id, model, path, question, paths):
if isinstance(entries, Failure):
return Stop(1, f"could not tell whether you typed anything: {entries.reason}")
if human_turns(entries) <= before:
return human.needed(TO, "the interrupt ended with nothing typed")
return human_needed.stop(TO, "the interrupt ended with nothing typed")
return None