diff --git a/bin/rung_replay/archive.py b/bin/rung_replay/archive.py index 54080e19..8b9f586c 100644 --- a/bin/rung_replay/archive.py +++ b/bin/rung_replay/archive.py @@ -4,10 +4,10 @@ import hashlib import json import pathlib import re +import subprocess import sys import time -from claude_code.reply import Claude from loop_effects.effects import Effects # The run's file starts with this line: what claude read and where, none of which its stream carries. Its type is none claude writes. @@ -25,7 +25,7 @@ def archiving(effects: Effects, folder: pathlib.Path) -> Effects: """effects whose claude also writes each run into folder: a line with the arguments, the working directory and the prompt, then the stream claude printed. A run is kept whether it failed or not, and once where it repeats a run; a folder that cannot be written is said on stderr and costs the replay nothing.""" claude = effects.claude - def run(args: list[str], cwd: str, prompt: str): + def run(args: list[str], cwd: str, prompt: str) -> subprocess.CompletedProcess[str]: proc = claude(args, cwd, prompt) content = "\n".join([json.dumps({"type": HEADER, "args": args, "cwd": cwd, "prompt": prompt}, ensure_ascii=False), proc.stdout]) try: diff --git a/bin/rung_replay/test_rung_replay.py b/bin/rung_replay/test_rung_replay.py index 1731a684..ea92de86 100644 --- a/bin/rung_replay/test_rung_replay.py +++ b/bin/rung_replay/test_rung_replay.py @@ -11,10 +11,10 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from rung_replay.archive import archiving, print_report, replay_folder from rung_replay.command import down_from +from loop_effects.effects import Effects from failure import Failure from rung_replay.search import first_reply, Miss, Replay, replayed, Tried from claude_code.reply import Limited -from loop_effects.effects import Effects from model_routing.ladder_file import read_ladder, SHIPPED from model_routing.ladder import Rung