Skip to content

Task Queue - Wait for Current Task Completion Before Submitting New Instructions #1054

Description

@juneleung

Is your feature request related to a problem? Please describe.

When submitting a new instruction while a previous task is still running, the new instruction interrupts the ongoing task midway. The two tasks then run in an interleaved/mixed manner, which can lead to:

  • Incomplete execution: The first task may never finish properly.
  • Unpredictable behavior: Outputs from both tasks get mixed together.
  • Data corruption: Shared state or files may be left in an inconsistent state.

Example scenario:

  1. User submits Task A (e.g., "Process all papers in collection X")
  2. Task A is 50% complete
  3. User submits Task B (e.g., "Export labels to JSON")
  4. Task A is interrupted, Task B starts
  5. Both tasks run interleaved, producing mixed/unexpected results

Describe the solution you'd like

Add a task queue mode option that ensures instructions are executed sequentially:

  • Default mode (current behavior): New instructions can interrupt ongoing tasks (backward compatible).
  • Queue mode (new option): When enabled, new instructions are queued and wait for the current task to complete before starting.

Suggested behavior when queue mode is enabled:

  • Display: "Task already running. Your instruction has been queued."
  • Execute tasks FIFO (First In, First Out)
  • Show queue status: "X tasks in queue, currently executing: [task name]"
  • Allow queue management: view queue, cancel queued tasks

Describe alternatives you've considered
None yet, wait for completion and then enter the next prompt.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions