Bindu
Bindu copied to clipboard
feat: Add PostgreSQL checkpoint storage with pause/resume support
Feature Fix Summary
- PostgreSQL Checkpoint Storage: Implemented checkpoint persistence with methods: save_checkpoint, get_checkpoint, delete_checkpoint, list_checkpoints, and cleanup_old_checkpoints.
- Database Migration: Added migration 20260306_0001_add_task_checkpoints.py to create the checkpoint table with proper indexes.
- Pause/Resume Architecture: Centralized pause/resume logic in the Worker base class to remove duplicated implementations.
- Task State Fix: Updated state management:
- Removed suspended from terminal_states
- Added it to non_terminal_states
- Introduced pausable_states
- Worker Pause/Resume Handling: Implemented _handle_pause and _handle_resume methods that save and restore checkpoints.
- URL Validation: Confirmed existing validation in notifications.py using urlparse with scheme and netloc checks.
- Integration Tests: Added 43 tests covering pause/resume behavior, checkpoint persistence, and state transitions.
- Documentation: Created docs/CHECKPOINTS.md and docs/STATE_TRANSITIONS.md.
- Checkpoint Cleanup: Added automatic cleanup in manifest_worker.py when tasks reach completed, failed, or canceled states.
Hey @Kkt04! Could you please join our Discord server when you get a chance? It’ll be easier for us to discuss everything there. Here’s the link: https://discord.gg/3w5zuYUuwt