It Ran Every Morning and Still Broke: Failure Modes of a Free-Tier AI Job
说明与用途
一个每天运行的 cron 任务,获取发布说明,使用 AI 模型进行摘要并写入文件,常常在不报错的情况下输出错误或空内容。文章列出了五种常见的失败模式,并提供了一个健康检查脚本,用于验证输出大小、结构、账本条目、状态一致性和截断警告。
问题
A daily cron job that fetches release notes, summarizes them with an AI model, and writes the summary failed silently on a free tier, producing incorrect or empty outputs without raising errors.
结果
The healthcheck script catches five common failure modes of free-tier AI jobs, turning silent failures into actionable alerts and ensuring reliable daily summaries.
工作流
- 1. Verify latest_summary.md is non-empty and >50 chars.
- 2. Check that summary contains expected sections: Breaking, Migration, Affects.
- 3. Confirm ledger.jsonl has a recent entry with today's date.
- 4. Ensure state file (last_seen.json) matches the ledger's tag.
- 5. Scan watch.log for any truncation warnings.
证据
The cron log said exit 0 every morning. The summary file updated on schedule. The job was running. The output was wrong.
The fix was to validate the response body against an expected shape, not just the status code.
The healthcheck script verifies output size, schema, ledger entry, state consistency, and truncation warnings.
- 记录日期: 2026-09-07T19:08:03.100Z