From 57fb31f2d68296e2524da31355094c14a6f5e692 Mon Sep 17 00:00:00 2001 From: KeelrLeek <156356974+KeelrLeek@users.noreply.github.com> Date: Wed, 7 Oct 2026 18:21:43 -0500 Subject: [PATCH] watch.py reports times in CST --- tools/watch.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/watch.py b/tools/watch.py index c6f0579..d262b5c 100644 --- a/tools/watch.py +++ b/tools/watch.py @@ -18,6 +18,19 @@ sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) from harbor import projects # noqa: E402 +def cst(iso): + """'2026-10-07T23:21:05Z' -> '18:21 CST' (US Central, as the User reads every time).""" + import datetime + from zoneinfo import ZoneInfo + try: + when = datetime.datetime.fromisoformat(str(iso).replace("Z", "+00:00")) + except ValueError: + return str(iso) + if when.tzinfo is None: + when = when.replace(tzinfo=datetime.timezone.utc) + return when.astimezone(ZoneInfo("America/Chicago")).strftime("%H:%M") + " CST" + + def snapshot(conn, me): q = lambda sql, *a: conn.execute(sql, a).fetchall() return { @@ -88,7 +101,7 @@ def main(): for agent, last in stalled(conn, project, args.me, args.stall): if agent in {a.strip() for a in args.ignore.split(",") if a.strip()}: continue - found.append(f"stalled: {agent} has made no tool call since {last[11:16]}Z (not stopped) - wake it") + found.append(f"stalled: {agent} has made no tool call since {cst(last)} (not stopped) - wake it") if found: print("\n".join(found)) return 0 @@ -96,7 +109,7 @@ def main(): tasks = conn.execute("SELECT state, COUNT(*) FROM tasks GROUP BY state").fetchall() last = conn.execute("SELECT agent, MAX(at) FROM activity_log GROUP BY agent").fetchall() print(f"quiet for {args.minutes:g} min; open review items {open_items}; tasks {dict(tasks)}; last tool call " - + ", ".join(f"{a} {t[11:16]}Z" for a, t in last)) + + ", ".join(f"{a} {cst(t)}" for a, t in last)) return 0