Skip to content

[Feature]: Implement Task Pausing and Resuming #491

@Prateekiiitg56

Description

@Prateekiiitg56

Currently, Bindu agents can start (run) and stop (cancel) tasks, but they cannot pause them. We need a way to support pausing and resuming tasks natively in the framework. This is important for tasks that take a long time, need to wait for external triggers, or require a human to review something before continuing.

I propose adding the missing pause_task and resume_task capabilities to the codebase:

  1. The Scheduler (bindu/server/scheduler/base.py): Update it so it can pass pause and resume commands down to the worker.
  2. The Worker (bindu/server/workers/base.py): Implement the logic to actually pause and resume the task.
    • Pausing a task will save its current progress to the database, free up memory, and mark it as 'suspended'.
    • Resuming a task will fetch the saved progress from the database, mark it as 'running', and pick up exactly where it left off.

Additional context
The placeholder functions for this (_handle_pause and _handle_resume) already exist in the codebase, but they currently just throw a NotImplementedError. Building this feature out will fix a known missing piece of the Agent-to-Agent (A2A) protocol and make our agents much more capable!

@raahulrahl assign this to me!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions