Skip to content

[Bug]: Unimplemented Task Pause/Resume Functionality in Base Worker #383

@Aditya8369

Description

@Aditya8369

Description:

The base worker class in bindu/server/workers/base.py has TODO comments and raises NotImplementedError for pause and resume operations. These critical task lifecycle features are called from the handler but lack implementation, preventing users from pausing long-running tasks or resuming suspended ones. This impacts usability in production scenarios with interruptible workflows.

Steps to Fix:

  1. Read bindu/server/workers/base.py to understand the existing task state management and storage interface.
  2. Implement _handle_pause(): Serialize current task execution state (e.g., agent context, partial results) to storage, update task state to "suspended", release resources.
  3. Implement _handle_resume(): Restore state from storage, update state to "resumed", continue execution from checkpoint using the scheduler.
  4. Add unit tests in tests/unit/test_workers.py (create if missing) covering pause/resume cycles with mock storage.
  5. Update README.md or docs/SCHEDULER.md to document the new functionality.
  6. Test end-to-end with pytest tests/unit/ and verify in integration tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions