From f0ff5845ca051e22c594339f4373627b9dbd3d3e Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Wed, 2 Dec 2026 10:59:21 -0700 Subject: [PATCH] Gate: keep check and retro blocks when only a lead node is ready; only the join's own block goes Co-Authored-By: Claude Opus 5.5 --- sisi/hooks.py | 4 +--- tests/test_plan.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sisi/hooks.py b/sisi/hooks.py index 8f0b212..31cb390 100644 --- a/sisi/hooks.py +++ b/sisi/hooks.py @@ -271,12 +271,10 @@ def gate(p, for_subagent=False): if isinstance(x, list) and len(x) == 2 and x[1] in (starts.get(x[0]) if isinstance(starts.get(x[0]), list) else ())] late = models.overdue({"starts": {w: [t for t in v if [w, t] not in seen] for w, v in starts.items() if isinstance(v, list)}, "meta": s.get("meta")}) reason, demand = " ".join("sisi: " + LATE % (w, time.strftime("%H:%M", time.localtime(t))) for w, t in late), False - held = False if not reason and isinstance(s.get("plan"), dict): # ready worker nodes not started: dispatch them before the turn ends from . import plan reason = plan.gate(s) - held = not reason and bool(plan.ready(plan.get(s) or {"nodes": []})) # only a lead node is ready: the lead may be waiting on its own job - if not reason and not s.get("paused") and not held: + if not reason and not s.get("paused"): checks = (s.get("done") or {}).get("checks") or [] unsaid = ["%d. %s" % (i, c["text"]) for i, c in enumerate(checks, 1) if not c["verdict"]] failed = [str(i) for i, c in enumerate(checks, 1) if c["verdict"] == "fail"] diff --git a/tests/test_plan.py b/tests/test_plan.py index 3d166ee..f3c3fe1 100644 --- a/tests/test_plan.py +++ b/tests/test_plan.py @@ -584,7 +584,7 @@ class Plan(unittest.TestCase): for n in ("a", "b", "c"): self.assertEqual(self.sisi("plan", "--done", n, "done by hand and tested", sid="s1")[0], 0) out = self.hook("gate")[1] - self.assertNotIn('"block"', out) + self.assertNotIn("is yours and ready", out) # the lead may be waiting on its own job; unsaid checks still speak for themselves def test_gate_still_blocks_on_a_ready_worker_node_beside_a_ready_lead_node(self): self.ready_plan()