Skip to content

feat(delegate): Rewrite delegation tool APIs to match Claude Code patterns #2057

Closed

Description

@simonrosenberg

Summary

The current delegation tool API surface (_delegate_tasks(), register_agent(), etc.) differs significantly from Claude Code's delegation patterns. To achieve feature parity and provide a familiar developer experience, the delegation APIs should be rewritten to align with Claude Code's Task tool interface.

Claude Code's Delegation API

Claude Code exposes delegation through a single Task tool with these key parameters:

  • prompt — The task description for the subagent
  • subagent_type — Which specialized agent to use (e.g. "Explore", "Plan", "Bash")
  • model — Optional model override for the subagent
  • run_in_background — Launch as non-blocking background task
  • resume — Resume a previous subagent by ID (preserves full context)
  • description — Short summary shown in UI
  • max_turns — Limit on agent turns

Complementary tools:

  • TaskOutput — Get output from a background task (with block and timeout params)
  • TaskStop — Stop a running background task by ID

Current OpenHands API

  • _delegate_tasks() with thread-based execution and thread.join() blocking
  • register_agent() for programmatic agent registration
  • No unified tool interface, no background support, no resume

Key Requirements

  • Unified Task tool (or equivalent) as the primary delegation interface
  • Support subagent_type, model, run_in_background, resume parameters
  • TaskOutput equivalent for polling background task results
  • TaskStop equivalent for terminating background tasks
  • Deprecate or wrap the existing _delegate_tasks() internals behind the new API
  • Maintain backward compatibility during transition

Related Issues

Activity

  1. self-assigned this
    on Feb 16, 2026
  2. linked a pull request that will close this issuefeat(tools): task tool set #2143on Feb 25, 2026
  3. VascoSch92 commented on Feb 25, 2026

    @VascoSch92
    Member

    Note that #2143 doesn't close completely this issue as a couple of things are missing.
    Precisely,

    • the API is missing the two parameters run_in_background and model
    • Just the TaskTool is implemented. The tools TaskOutput and TaskStop will be implemented when we will able to run tasks in background.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions