emit_interrupts(
interrupts: Iterable[Interrupt],
stream: ResponseEventStream
) -> AsyncIterator[AnyYield Responses API events that surface pending interrupts.
Each interrupt produces two output items in the same response:
function_call item (name :data:HITL_FUNCTION_NAME,
call_id = interrupt.id, arguments = the JSON envelope
from :func:interrupt_arguments_json).mcp_approval_request item with a generated mcpr_* id,
server_label = :data:HITL_MCP_SERVER_LABEL, same name and
arguments).Both items carry the same interrupt.id so the inbound resume
matches the same logical pause regardless of which channel the
client chose.
The interrupts to emit (typically from
:func:detect_pending_interrupts).
The :class:ResponseEventStream to emit through.