A lead waiting on a delegation that is open and not late is not stopped for checks without a verdict

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Sonnet 5.5 committed 2026-11-24 13:32:13 -07:00
1 parent 85b9f1489d
commit 6a5ed356a2
3 files changed
+27 -1

No files matched your search

+1 -1
View File
@@ -208,7 +208,7 @@ def gate(p, for_subagent=False):
from . import retro
retro.record(s, cwd, {}) # every check passed and nothing changed: the work closes itself
return 0
reason = OPEN % "; ".join(unsaid) if unsaid else GATE if worked else FAILED % ", ".join(failed) if failed else ""
reason = "" if unsaid and models.waiting(s) else OPEN % "; ".join(unsaid) if unsaid else GATE if worked else FAILED % ", ".join(failed) if failed else ""
if not reason or s.get("blocks", 0) >= 2:
return 0
s["blocks"] = s.get("blocks", 0) + 1
+5
View File
@@ -141,6 +141,11 @@ def overdue(s):
return [(w, min(old(v))) for w, v in (starts.items() if isinstance(starts, dict) and type(mins) in (int, float) else []) if old(v)]
def waiting(s):
"""A delegation of this piece of work is open: started and not yet judged."""
return isinstance(s.get("starts"), dict) and any(isinstance(v, list) and v for v in s["starts"].values())
def out(r, skip, bad, today):
"""Why this worker is off the wheel, "" when it is on."""
until = [d for d in re.findall(r"out until (\d{4}-\d{2}-\d{2})", " ".join(r).lower()) if d > today]
+21
View File
@@ -1428,6 +1428,27 @@ class Core(unittest.TestCase):
self.assertEqual(self.sisi("judge", "sonnet", "bad", "cancelled, never reported", sid="s1")[0], 0)
self.assertFalse(late())
def test_a_lead_waiting_on_a_worker_that_is_not_late_is_not_stopped_for_open_checks(self):
self.table(WORKERS)
self.hook("tick")
self.hook("prompt", prompt="go")
self.done()
self.assertIn("no verdict yet", self.hook("gate")[1]) # no delegation open: blocked as before
self.assertEqual(self.sisi("pick", "hard", sid="s1")[0], 0)
self.assertEqual(self.tool("Agent", tool_input={"model": "sonnet"})[0], 0)
for turn in range(5): # each wake-up of the lead is a request
self.hook("prompt", prompt="the delegated task finished %d" % turn)
self.assertEqual(self.hook("gate")[1], "", turn) # started, not judged, not late: waiting
with open(os.path.join(self.tmp, "state", "core-sessions", "s1.json"), "r+") as f:
st = json.load(f)
st["starts"]["sonnet"] = [time.time() - 16 * 60]
f.seek(0), f.truncate(), json.dump(st, f)
self.hook("prompt", prompt="still nothing")
self.assertIn("has not reported", self.hook("gate")[1]) # late: the LATE message as before
self.assertEqual(self.sisi("judge", "sonnet", "good", "reported and was checked", sid="s1")[0], 0)
self.hook("prompt", prompt="judged")
self.assertIn("no verdict yet", self.hook("gate")[1]) # judged: no delegation open again
def test_the_spec_is_unchanged(self):
for line in self.read(REPO, "docs", "spec", "SHA256SUMS").splitlines():
digest, rel = line.split()