Skip to main content

handoff_request

Escalates the conversation to a human (email, Telegram, Slack, Discord, WhatsApp, owner inbox) or to a sibling agent via one of the agent’s configured handoff channels. The model chooses channel_id from the agent’s currently-configured handoff channels (also listed in the tool description). The input schema constrains channel_id to currently-available ids so the model can’t invent one. After a successful call, the next subscriber turn is bypassed: messages route directly to the recipient until the session is released (form submission, /release token, sibling-agent handoff_release, or 30-minute idle timeout).

Parameters

expected_return schema

A list of up to 20 fields the recipient (human form or sibling agent) is asked to fill before releasing the handoff. Each field:
Supported type values: string, multiline, number, boolean, enum, date, url. Validation is best-effort. Missing required fields are logged into the audit trail but do NOT block the release; the originator’s LLM sees what came back and what was missing on its next turn.

How the recipient fills it

  • Human via email / Telegram / Slack / Discord / WhatsApp — the dispatch body includes a time-limited link to a return form (one input per field, typed per type) plus a plain-text preview of the fields. The recipient can forward the link to a colleague.
  • Owner via Inbox — the same link surfaces as a “Fill return form” button on the active-handoff status strip.
  • Sibling agent — the schema is rendered into the receiving agent’s initial context as an [EXPECTED RETURN SCHEMA] block. It calls handoff_release with return_values: { … }.

How the values come back to you

After release, the originator’s chat gets a [Bot resumed — …] system message. When expected_return was set, that message includes a Returned data: block with the filled values, e.g.:
The originator’s LLM reads this on its next turn. Use the values directly — don’t paraphrase the field names.

Returns

On success:
On dispatch failure: { error, details: { handoff_event_id, hint, ... } } — the session is marked failed and the bypass is NOT activated.

Call from your own custom tool

Notes

  • Only registered when at least one handoff channel is available.
  • Each handoff is delivered through the configured channel (email, Telegram, Slack, Discord, WhatsApp, the owner Inbox, or a sibling agent).
  • Every attempt (success or failure) is recorded for the audit trail. human_notified is true only when dispatch succeeded.
  • The LLM cannot fake a handoff: success requires the dispatcher to return ok.