You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(delegate): Rewrite delegation tool APIs to match Claude Code patterns #2057
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
Activity
VascoSch92 commentedon Feb 25, 2026
Note that #2143 doesn't close completely this issue as a couple of things are missing.
Precisely,
run_in_backgroundandmodelTaskToolis implemented. The toolsTaskOutputandTaskStopwill be implemented when we will able to run tasks in background.