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.
Environment
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 customreturn_to_callertool whose arguments are the deliverable). Today the only officially visible outcome ofTaskManager.start_task(...)isTask.result— the value ofget_agent_final_response(...), i.e. the child's final prose/finish message, not its terminal ActionEvents._run_taskcloses the child conversation in afinallyvia_evict_task, so the events are gone by the time the caller inspects the Task. The only way to capture them is wrapping the privateTaskManager._evict_taskat instance level before spawning — a private-API dependency we would like to drop.Ask
Any of:
Task(e.g.Task.terminal_events— the last N ActionEvents, or all tool-call events),on_task_complete(task, conversation_state)callback / hook,Happy to turn this into a PR if there is a preferred shape.