Handles agent interrupts with optional filtering, preprocessing, and resume behavior.
Supports both the AG-UI standard interrupt flow (RUN_FINISHED with
outcome.type === "interrupt") and the legacy custom-event flow
(on_interrupt). For standard interrupts, render receives interrupt
(the primary one) and interrupts (the full open set); call resolve(payload)
to resume or cancel() to cancel. Resuming addresses the targeted interrupt
and, once every open interrupt is addressed, submits a single spec resume
array via copilotkit.runAgent.
renderInChat: true (default): the element is published into <CopilotChat>; returns void.
renderInChat: false: the hook returns the interrupt element for manual placement.
Handles agent interrupts with optional filtering, preprocessing, and resume behavior.
Supports both the AG-UI standard interrupt flow (
RUN_FINISHEDwithoutcome.type === "interrupt") and the legacy custom-event flow (on_interrupt). For standard interrupts,renderreceivesinterrupt(the primary one) andinterrupts(the full open set); callresolve(payload)to resume orcancel()to cancel. Resuming addresses the targeted interrupt and, once every open interrupt is addressed, submits a single specresumearray viacopilotkit.runAgent.renderInChat: true(default): the element is published into<CopilotChat>; returnsvoid.renderInChat: false: the hook returns the interrupt element for manual placement.