H.Session.Subagents (H v0.3.0)

Copy Markdown View Source

Coordinator-managed subagent delegation lifecycle for H.Session.Server.

Persists idempotent child intent (memos) and "waiting" state before calling H.Daemon, dispatches child sessions and submissions outside storage commits, holds zero Task.Supervisor workers while parked, wakes on {:submission_settled, outcome}, and recovers idempotently across crashes and VM restarts.

Summary

Functions

Propagates a parent conversation abort to an owned child session.

Builds H.Daemon options targeting the same isolated runtime/catalog/provider as the parent session.

Removes watch tracking for {child_sid, child_req_id} from coordinator state.

Re-attaches and re-watches a parked "waiting" subagent tool task after coordinator crash or VM restart.

Validates semantic arguments for a "subagent" tool call and dispatches or parks it according to mode ("wait", "start", "await", "steer", "abort").

Stages an error tool result when subagent dispatch, attach, or watch fails.

Stages settlement for a waiting "subagent" tool task when {:submission_settled, outcome} arrives.

Unregisters self() from PubSub submission settlement for {child_sid, child_req_id}.

Functions

abort_child(child_sid, child_cid, reason, state)

Propagates a parent conversation abort to an owned child session.

child_daemon_opts(state)

Builds H.Daemon options targeting the same isolated runtime/catalog/provider as the parent session.

remove_watch(state, child_sid, child_req_id, task_id)

Removes watch tracking for {child_sid, child_req_id} from coordinator state.

resume_waiting(cid, tool_task_id, state)

Re-attaches and re-watches a parked "waiting" subagent tool task after coordinator crash or VM restart.

spawn_or_dispatch(cid, tool_task, validated_args, state, apply_effects_fn)

Validates semantic arguments for a "subagent" tool call and dispatches or parks it according to mode ("wait", "start", "await", "steer", "abort").

stage_failed(tool_task_id, reason, state)

Stages an error tool result when subagent dispatch, attach, or watch fails.

stage_settled(outcome, state)

Stages settlement for a waiting "subagent" tool task when {:submission_settled, outcome} arrives.

unwatch(child_sid, child_req_id, state)

Unregisters self() from PubSub submission settlement for {child_sid, child_req_id}.