Annotate the return type of every function in loop_claude

This commit is contained in:
2026-09-29 12:23:37 +02:00
parent 0842135b87
commit d13658967a
20 changed files with 62 additions and 58 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ from loop_claude.claude_code.transcript import part_line
from loop_claude.outcome import Failure
def run_worker(root, args):
def run_worker(root, args) -> Failure | None:
try:
proc = subprocess.Popen(["claude", *args], cwd=root, encoding="utf-8", errors="replace", stdin=subprocess.DEVNULL, stdout=subprocess.PIPE)
except OSError as failure:
@@ -26,7 +26,7 @@ def run_worker(root, args):
return None if done else Failure("claude exited 0 without a result event")
def worker_args(task, session, model, resuming):
def worker_args(task, session, model, resuming) -> list[str]:
if resuming:
start = ["-p", "Continue the task; the previous run stopped before it was finished.", "--resume", str(session.id)]
else: