A scheduling interaction driven from a button grid outside the chat (a popup in the app surface). The chat triggers the agent; when the agent needs the user to pick a time, the popup appears in the app surface, not in the chat. Picking a slot resolves the pending tool call and the agent replies.
The LangGraph version of this demo uses a custom useHeadlessInterrupt hook
that listens for LangGraph's native interrupt() event on the AG-UI stream
and resumes via copilotkit.runAgent({ forwardedProps: { command: { resume } } }).
Microsoft Agent Framework has no interrupt primitive, so this port is
adapted:
- The backend agent (
src/agents/interrupt_agent.py) is prompted to callschedule_meetingby name. - The frontend registers
schedule_meetingviauseFrontendTool. The async handler sets thependingpayload (making the popup render in the left pane) and then returns a Promise that only resolves once the user clicks a slot or cancels in the popup.renderreturnsnullso nothing appears inside the chat itself.
The user-visible UX is equivalent to the LangGraph version. The underlying mechanism differs.
- Backend agent:
src/agents/interrupt_agent.py(shared withgen-ui-interrupt) - HTTP mount:
/interrupt-adaptedinsrc/agent_server.py - Sibling demo:
src/app/demos/gen-ui-interrupt(inline-in-chat picker)