Skip to content

feat(delegate): Non-blocking background subagent execution #2047

Open

Description

@simonrosenberg

Summary

_delegate_tasks() in openhands-tools/openhands/tools/delegate/impl.py uses thread.join() to block the parent agent until the sub-agent completes. This prevents the parent from doing other work while waiting for long-running sub-agent tasks.

Proposed Solution

Add a background flag to delegation that returns immediately with task IDs, plus commands for polling status, retrieving output, and stopping background agents.

Key Requirements

  • Add background: bool parameter to delegation
  • When background=True, return immediately with a task ID
  • Implement check_status(task_id) to poll sub-agent state
  • Implement get_output(task_id) to retrieve results when complete
  • Implement stop(task_id) to terminate a running background agent
  • Track background agents in a registry for the parent context

Key Files

  • openhands-tools/openhands/tools/delegate/impl.py — _delegate_tasks() with thread.join()

Acceptance Criteria

  • background flag is supported in delegation
  • Parent agent is not blocked when background=True
  • Task ID is returned for background agents
  • Status polling, output retrieval, and stop commands work
  • Multiple background agents can run concurrently

Activity

  1. all-hands-bot commented on Mar 26, 2026

    @all-hands-bot
    Collaborator

    This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.

  2. all-hands-bot commented on Apr 5, 2026

    @all-hands-bot
    Collaborator

    This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.

  3. github-actions commented on May 16, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.

  4. github-actions commented on May 26, 2026

    @github-actions
    Contributor

    This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.

  5. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.

  6. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    This issue was automatically closed due to 50 days of inactivity. We do this to help keep the issues somewhat manageable and focus on active issues.

  7. all-hands-bot commented on Aug 21, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has had no activity for 32 days (labels: delegation, enhancement). @enyst @neubig @xingyaoww, could you take a look when you have a chance and help figure out next steps?

    Generated by OpenHands automation on behalf of the user.

  8. all-hands-bot commented on Sep 29, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has had no activity for 34 days (labels: enhancement). @enyst @neubig @xingyaoww, could you take a look when you have a chance and help figure out next steps?

    Generated by OpenHands automation on behalf of the user.

  9. all-hands-bot commented on Nov 17, 2026

    @all-hands-bot
    Collaborator

    [Automatic Post]: This issue has had no activity for 48 days (labels: enhancement). Could someone take a look when they have a chance and help figure out next steps?

    Generated by OpenHands automation on behalf of the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions