Bindu icon indicating copy to clipboard operation
Bindu copied to clipboard

feat: Add PostgreSQL checkpoint storage with pause/resume support

Open Kkt04 opened this issue 8 months ago • 1 comments

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.

Kkt04 avatar Mar 06 '26 01:03 Kkt04

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

Paraschamoli avatar Mar 23 '26 06:03 Paraschamoli