From 48da58866399823bd361b566e9da7085b34bac3a Mon Sep 17 00:00:00 2001 From: Time Date: Mon, 19 Oct 2026 02:19:38 +0000 Subject: [PATCH] card #85: update dojo/agent-management/03_retry_on_your_own.py --- dojo/agent-management/03_retry_on_your_own.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dojo/agent-management/03_retry_on_your_own.py diff --git a/dojo/agent-management/03_retry_on_your_own.py b/dojo/agent-management/03_retry_on_your_own.py new file mode 100644 index 0000000..5d2f3e8 --- /dev/null +++ b/dojo/agent-management/03_retry_on_your_own.py @@ -0,0 +1,19 @@ +BELT = "green" +PROMPT = "Card #1 has an `error` beat and no PR. Handle it. finish when done." + + +def build(L): + return L.World([L.card(1, "Add x", "app.py sets x = 2")], {1: [L.beat("dispatched", 3), L.beat("error", 1)]}, seat="opus") + + +def move(do, w): + do("read", number=1) + do("comment", number=1, text="The worker call failed with an error and no PR exists, so nothing is lost by another try. /time retry") + return "retried" + + +def grade(L, w, answer, judge): + mine = [t for n, t in w.posted if n == 1] + assert mine and any("/time retry" in t or L.tm.MARK in t for t in mine), "a retry or dispatch beat" + assert any(("error" in t.lower() or "fail" in t.lower()) and len(t) > 30 for t in mine), "says why" + assert "needs-human" not in w.issues[1]["labels"] and not w.escalated and not any("needs a human" in t.lower() for t in mine), "asks nobody"