From ce82b0c3cf7839993db23a38ed28c1bbe366ef1b Mon Sep 17 00:00:00 2001 From: wyuebei-cloud Date: Wed, 1 Jul 2026 14:24:38 -0700 Subject: [PATCH] fix: `hermes journey` crashes on Windows due to `%-d` strftime directive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_period_label()` in `learning_graph_render.py` used `%-d %b` strftime, which is a Linux-only format — the `%-` prefix for zero-padding suppression doesn't exist on Windows `strftime`, causing `ValueError: Invalid format string` on `hermes journey`. Fix by using `dt.day` directly (an integer, no zero-padding by default) combined with `strftime('%b')` for the month. This is cross-platform and produces identical output. Reproduced and tested on Windows 10 with Hermes v0.18.0. --- agent/learning_graph_render.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/learning_graph_render.py b/agent/learning_graph_render.py index ab705f609ce..c367cbf7bbb 100644 --- a/agent/learning_graph_render.py +++ b/agent/learning_graph_render.py @@ -255,7 +255,7 @@ def _period_key(ts: float, granularity: str) -> tuple[int, ...]: def _period_label(ts: float, granularity: str) -> str: dt = datetime.fromtimestamp(ts, tz=timezone.utc) if granularity == "day": - return dt.strftime("%-d %b") + return f"{dt.day} {dt.strftime('%b')}" if granularity == "month": return dt.strftime("%b %Y") return dt.strftime("%Y")