From e62c3ecda8c66e3b045fb1352ade2bb87dd46a1c Mon Sep 17 00:00:00 2001 From: 23241a6749 Date: Sat, 4 Jul 2026 07:59:38 +0000 Subject: [PATCH] fix: log _write_last_run failures instead of silent swallow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The _write_last_run() function silently swallowed all exceptions with 'except Exception: pass'. Cache write failures (disk full, permissions, serialization errors) were completely invisible — no log, no stderr message, no metric. This made debugging report-cache issues impossible because the caller could not distinguish 'cache written' from 'cache write failed silently'. Fix: log the exception message to stderr with the [last30days] prefix, consistent with other error messages in the same file. --- skills/last30days/scripts/last30days.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/last30days/scripts/last30days.py b/skills/last30days/scripts/last30days.py index 3a05b448..78315422 100644 --- a/skills/last30days/scripts/last30days.py +++ b/skills/last30days/scripts/last30days.py @@ -720,8 +720,8 @@ def _write_last_run( ], } (target / "last-report.json").write_text(json.dumps(cache_payload, indent=2)) - except Exception: - pass + except Exception as exc: + sys.stderr.write(f"[last30days] Failed to write run cache: {exc}\n") def _load_last_report_cache(