Answer the architect's first round
This commit is contained in:
@@ -20,14 +20,10 @@ def interrupt(root, session_id, model, path, question, paths, effects: Effects)
|
||||
return Stop(1, entries.reason)
|
||||
before = human_turns(entries)
|
||||
try:
|
||||
effects.run(["claude", "--model", model, "--permission-mode", "bypassPermissions", "--resume", str(session_id)], cwd=root)
|
||||
effects.claude_on_terminal(["--model", model, "--permission-mode", "bypassPermissions", "--resume", str(session_id)], root)
|
||||
except OSError as failure:
|
||||
return Stop(1, f"could not start claude for the interrupt: {failure.strerror}")
|
||||
entries = read(path)
|
||||
if isinstance(entries, Failure):
|
||||
return Stop(1, f"could not tell whether you typed anything: {entries.reason}")
|
||||
return None if typed_since(before, entries) else human_needed.stop(TO, "the interrupt ended with nothing typed")
|
||||
|
||||
|
||||
def typed_since(turns_before, entries) -> bool:
|
||||
return human_turns(entries) > turns_before
|
||||
return None if human_turns(entries) > before else human_needed.stop(TO, "the interrupt ended with nothing typed")
|
||||
|
||||
Reference in New Issue
Block a user