From e6f7306c472a7589d08f4098e476d54bffd1f761 Mon Sep 17 00:00:00 2001 From: godosa Date: Wed, 7 Oct 2026 19:56:05 +0200 Subject: orch post: strip 'result:' prefix Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2 --- tests/test_orch.py | 12 ++++++++++++ wf.py | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/test_orch.py b/tests/test_orch.py index 45ade24..313007f 100644 --- a/tests/test_orch.py +++ b/tests/test_orch.py @@ -237,6 +237,18 @@ class OrchTest(Cli): self.assertNotIn("post-check-red", self.log()) self.assertIn(" t-big sliced ", self.log()) + def test_post_result_prefix_stripped(self): + self.orch("pick", "fast") + out = self.orch("post", "t-one", "fast", "--result", "result: handback unclear spec") + self.assertTrue(out.startswith("post: t-one handback\n"), out) + self.assertNotIn("stop lane", out) + + def test_post_result_prefix_done(self): + self.orch("pick", "fast") + self.worker_done() + out = self.orch("post", "t-one", "fast", "--result", "result: done", "--no-pick") + self.assertTrue(out.startswith("post: t-one done"), out) + def test_post_model_raised_continues(self): self.orch("pick", "fast") self.wf("set", "t-one", "--model", "opus") diff --git a/wf.py b/wf.py index ac279cd..052ab63 100755 --- a/wf.py +++ b/wf.py @@ -1851,7 +1851,10 @@ def orch_post(main: Path, p: Project, args) -> int: item = p.doc.item(id) if id in p.doc.ids() else None if item is None and id not in p.archived: raise Failure(tasks.unknown_id(id, p.doc.ids())) - words = (args.result or "").split() + line = (args.result or "").strip() + if line[:7].lower() == "result:": + line = line[7:].strip() # literal report line 'result: done' + words = line.split() outcome = words[0] if words else ("done" if id in p.archived else "no-report") if outcome == "done" and item is not None and id not in p.archived and tasks.open_slices(p.doc, id): outcome = "sliced" # slice job: worker said done but the task is open with slices -- cgit