1
0

[kimi] Add JSON validation guard to queue.json writes (#952) (#995)

This commit is contained in:
2026-03-22 22:33:40 +00:00
parent 1fa5cff5dc
commit e24f49e58d
4 changed files with 291 additions and 1 deletions

View File

@@ -202,7 +202,11 @@ def load_queue() -> list[dict]:
# Persist the cleaned queue so stale entries don't recur
_save_cleaned_queue(data, open_numbers)
return ready
except (json.JSONDecodeError, OSError):
except json.JSONDecodeError as exc:
print(f"[loop-guard] WARNING: Corrupt queue.json ({exc}) — returning empty queue")
return []
except OSError as exc:
print(f"[loop-guard] WARNING: Cannot read queue.json ({exc}) — returning empty queue")
return []