Skip to content

The agent that grows with you

fix(skills): warn when compaction is skipped because the ledger is unreadable

kshitijk4poor2a9c27f1debf
diff --git a/tools/skill_ledger.py b/tools/skill_ledger.py
index ff5154ca827..014005f902b 100644
--- a/tools/skill_ledger.py
+++ b/tools/skill_ledger.py
@@ -305,7 +305,8 @@ def compact_ledger() -> Tuple[int, int, int]:
try:
raw = path.read_bytes()
text = raw.decode("utf-8")
- except (OSError, UnicodeError):
+ except (OSError, UnicodeError) as exc:
+ logger.warning("skill_ledger: ledger unreadable (%s); compaction skipped", exc)
return 0, 0, 0
out, kept = [], 0
for line in text.splitlines():