digest: fall back to any successful tone variant, not just INTERMEDIATE

This commit is contained in:
Giorgio Gilestro 2026-05-25 23:14:46 +02:00
parent 2462882006
commit 1fdf7d6a23

View file

@ -184,7 +184,12 @@ async def run() -> None:
written = 0 written = 0
for u in fresh: for u in fresh:
tone = (u.digest_tone or "INTERMEDIATE").upper() tone = (u.digest_tone or "INTERMEDIATE").upper()
content = variants.get(tone) or variants.get("INTERMEDIATE") # Fall back to INTERMEDIATE first (the more common tone) and then
# to whatever variant succeeded, so an asymmetric LLM failure
# doesn't silently skip the user.
content = (variants.get(tone)
or variants.get("INTERMEDIATE")
or next(iter(variants.values()), None))
if content is None: if content is None:
continue continue
await _send_one(u, kind, content, date_str, session) await _send_one(u, kind, content, date_str, session)