Skip to content

SandboxInterrupt

Defined in: error/error.ts:17

Thrown by Sandbox.eval when an action interrupts the run (by throwing ActionInterrupt from core). Carries everything a caller needs to persist and later resume the run: the call log accumulated up to the interrupt (pass it back to eval, together with a resumption targeting position), the data snapshot at the interrupt, and the interrupting action’s own payload and checkpoint under interrupt.

The call log may contain null slots: an interrupted call reserves its position but never records, while concurrent calls started after it may complete and record behind it.

  • Error
new SandboxInterrupt(message, options): SandboxInterrupt;

Defined in: error/error.ts:27

Parameter Type
message string
options { callLog: ( | { input: unknown; name: string; response: unknown; type: "action"; } | { response: number; type: "random"; } | { response: number; type: "now"; } | null)[]; console: { level: "log" | "info" | "warn" | "error" | "debug"; message: string; }[]; data: Record<string, unknown>; interrupt: { data?: unknown; state?: unknown; }; position: number; }
options.callLog ( | { input: unknown; name: string; response: unknown; type: "action"; } | { response: number; type: "random"; } | { response: number; type: "now"; } | null)[]
options.console { level: "log" | "info" | "warn" | "error" | "debug"; message: string; }[]
options.data Record<string, unknown>
options.interrupt { data?: unknown; state?: unknown; }
options.interrupt.data? unknown
options.interrupt.state? unknown
options.position number

SandboxInterrupt

Error.constructor
readonly callLog: (
| {
input: unknown;
name: string;
response: unknown;
type: "action";
}
| {
response: number;
type: "random";
}
| {
response: number;
type: "now";
}
| null)[];

Defined in: error/error.ts:18


readonly console: {
level: "log" | "info" | "warn" | "error" | "debug";
message: string;
}[];

Defined in: error/error.ts:21

Console output captured up to the interrupt. A resumed run regenerates the full output.

level: "log" | "info" | "warn" | "error" | "debug";
message: string;

readonly data: Record<string, unknown>;

Defined in: error/error.ts:19


readonly interrupt: {
data?: unknown;
state?: unknown;
};

Defined in: error/error.ts:25

The interrupting action’s caller-facing payload and private checkpoint.

optional data?: unknown;
optional state?: unknown;

readonly position: number;

Defined in: error/error.ts:23

Call-log position of the action call that interrupted the run.