From 48e69063b8f0ea2b8332b7ed9e5e2da9bd3475f2 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 17 Nov 2026 02:33:12 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20product-owner=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1=20(0=20misread);=20a=20kept=20?= =?UTF-8?q?run's=20header=20records=20claude's=20exit=20code=20and=20stder?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/rung_replay/archive.py | 2 +- bin/rung_replay/test_rung_replay.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/rung_replay/archive.py b/bin/rung_replay/archive.py index 07db1335..92ecc91f 100644 --- a/bin/rung_replay/archive.py +++ b/bin/rung_replay/archive.py @@ -27,7 +27,7 @@ def archiving(effects: Effects, folder: pathlib.Path) -> Effects: 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]) + content = "\n".join([json.dumps({"type": HEADER, "args": args, "cwd": cwd, "prompt": prompt, "returncode": proc.returncode, "stderr": proc.stderr}, ensure_ascii=False), proc.stdout]) try: folder.mkdir(mode=0o700, parents=True, exist_ok=True) (folder / f"{hashlib.sha256(content.encode()).hexdigest()}.jsonl").write_text(content, encoding="utf-8") diff --git a/bin/rung_replay/test_rung_replay.py b/bin/rung_replay/test_rung_replay.py index 72252265..f22a5082 100644 --- a/bin/rung_replay/test_rung_replay.py +++ b/bin/rung_replay/test_rung_replay.py @@ -111,7 +111,7 @@ class ArchivedRuns(unittest.TestCase): first, second = (path.read_text(encoding="utf-8").splitlines() for path in self.kept()) prompts = sorted((json.loads(lines[0]) for lines in (first, second)), key=lambda header: header["prompt"]) self.assertEqual(prompts, [ - {"type": "replay_run", "args": ["-p", "--agent", "prose-reviewer"], "cwd": "/clone", "prompt": prompt} for prompt in ("Review it.", "Review that.") + {"type": "replay_run", "args": ["-p", "--agent", "prose-reviewer"], "cwd": "/clone", "prompt": prompt, "returncode": 0, "stderr": ""} for prompt in ("Review it.", "Review that.") ]) self.assertEqual(first[1:], stream.splitlines()) @@ -126,7 +126,8 @@ class ArchivedRuns(unittest.TestCase): run([], "/r", "p") run([], "/r", "p") self.assertEqual(len(self.kept()), 1) - self.assertIn("half a stream", self.kept()[0].read_text(encoding="utf-8")) + kept = self.kept()[0].read_text(encoding="utf-8").splitlines() + self.assertEqual((json.loads(kept[0])["returncode"], json.loads(kept[0])["stderr"], kept[1]), (1, "boom", "half a stream")) def test_keeps_nothing_where_claude_did_not_start_and_says_where_it_could_not_keep_a_run(self): def missing(args, cwd, prompt):