Skip to content

The agent that grows with you

fix(skills): treat an undecodable ledger as empty in list_entries()

kshitijk4poor83cf0ef801b7
diff --git a/tools/skill_ledger.py b/tools/skill_ledger.py
index 014005f902b..6c4b63d7ca1 100644
--- a/tools/skill_ledger.py
+++ b/tools/skill_ledger.py
@@ -411,7 +411,7 @@ def list_entries(skill: Optional[str] = None, limit: Optional[int] = None) -> Li
"""Read the ledger, newest first. Malformed lines are skipped."""
try:
lines = ledger_path().read_text(encoding="utf-8").splitlines()
- except OSError: # missing or unreadable ledger == empty
+ except (OSError, UnicodeError): # missing, unreadable or undecodable ledger == empty
return []
rows: List[Dict[str, Any]] = []
for line in lines: