Skip to content

Feature: expose a completed subagent task's terminal ActionEvents (or an on-complete callback) for custom delegation tools #4852

Description

@valeriiD

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.

Activity

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

    enhancementNew feature or requestrelease-note-requiredPR requires explicit release-note coverage for behavioral or default changessdktools

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions