Skip to content

InterruptParams

Defined in: src/types/interrupt.ts:14

Parameters for raising an interrupt.

name: string;

Defined in: src/types/interrupt.ts:19

User-defined name for the interrupt. Must be unique within a single hook callback or tool execution.


optional reason?: JSONValue;

Defined in: src/types/interrupt.ts:24

User-provided reason for the interrupt.


optional response?: JSONValue;

Defined in: src/types/interrupt.ts:42

Preemptive response to use if available. When provided, the interrupt returns this value immediately without halting agent execution. Useful for session-managed trust responses where a previous user response can be reused.

// If user already approved in a previous session, skip the interrupt
const approval = context.interrupt({
name: 'confirm_delete',
reason: 'Confirm deletion?',
response: agent.appState['savedApproval'],
})