OpenHands / OpenHands/software-agent-sdk
Feature: expose a completed subagent task's terminal ActionEvents (or an on-complete callback) for custom delegation tools
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 539
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 137
Description
Environment
- openhands-sdk / tools 1.44.1 (TaskToolSet / TaskManager path)
Context
We wrap the task tool under a custom delegation primitive (new_task-style) and need the child's STRUCTURED terminal tool calls (the child ends by calling a custom return_to_caller tool whose arguments are the deliverable). Today the only officially visible outcome of TaskManager.start_task(...) is Task.result — the value of get_agent_final_response(...), i.e. the child's final prose/finish message, not its terminal ActionEvents.
_run_task closes the child conversation in a finally via _evict_task, so the events are gone by the time the caller inspects the Task. The only way to capture them is wrapping the private TaskManager._evict_task at instance level before spawning — a private-API dependency we would like to drop.
Ask
Any of:
- keep a terminal-events snapshot on the completed
Task(e.g.Task.terminal_events— the last N ActionEvents, or all tool-call events), - or an optional
on_task_complete(task, conversation_state)callback / hook, - or an officially supported "structured subtask return" channel (e.g. a finish-with-payload equivalent the parent can read from the Task).
Happy to turn this into a PR if there is a preferred shape.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TaskManager.start_task and trace _run_task through _evict_task, comparing the completed Task.result with get_agent_final_response. Review TaskToolSet and the Task model to determine which supported completion shape fits terminal ActionEvents or structured returns. Done means a documented public channel lets a parent inspect the completed subtask’s structured result without wrapping private APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100