fix(async-agent): improve save_checkpoint directory creation and handle null tasks in load_checkpoint - #487
Conversation
…le null tasks in load_checkpoint
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
bojieli
left a comment
There was a problem hiding this comment.
The null-tasks path is still broken before the guarded log line: load_checkpoint calls self.tasks.restore(data.get("tasks", [])), which passes None when the JSON contains "tasks": null. TaskManager.restore then iterates over None and raises TypeError. The included test uses MagicMock for runtime.tasks, so it masks this failure. Please normalize once (for example, tasks = data.get("tasks") or []), pass that value to restore and use it for the count, then exercise load_checkpoint with a real TaskManager in the regression test.
In
chapter4/async-agent/runtime.py,save_checkpointraisedFileNotFoundErrorwhen target parent directories did not exist, andload_checkpointraisedTypeErrorduring log formatting when a checkpoint JSON had"tasks": null.This fix automatically creates parent directories via
os.makedirsand useslen(data.get('tasks') or []). Includes regression tests inchapter4/async-agent/test_checkpoint_robustness.py.