Handling Callbacks

Who this is for: plugin developers and agent authors designing clarification, approval, recovery, and escalation flows.

Callback Kinds

The intent explains what type of answer is needed. The kind explains where the runtime should try to get it.

When To Use Which

Agent Metadata

Agent sidecar JSON controls whether callbacks may go upward or directly to the host:

{
  "can_query_caller": true,
  "can_use_host_interaction": true,
  "callback_policy": {
    "passthrough_child_callbacks": false,
    "max_bubble_hops": 2,
    "fallback_target": "user"
  }
}

Useful keys:

Per-Decision Routing Hints

Callback parameters may override the defaults:

These are useful when one callback should skip orchestration agents or only a specific specialist parent is allowed to resolve it.

Common Scenarios

Caller-mediated clarification

Use callback_to_caller when a parent agent may resolve, transform, or escalate the request with better context.

Direct user clarification

Use request_user_input for intake or clarification specialists that should talk to the user directly.

Agent-only resolution

Use request_resolution when the answer must come from tools, memory, or another agent, not from the user.

Skip orchestration layers

If controllers or workflow wrappers should not spend tokens on a child callback, use:

Parallel Child Caveat

Sequential children may ask the user directly. Parallel batch children still should not assume they can synchronously block on user interaction in the same way.

Failure Modes

Next Steps