mastra-ai/mastra · error · TripWire

Tripwire triggered by ${processor.id}

Error message

Tripwire triggered by ${processor.id}

What it means

Inside the state-signal execution loop, the runner defines an abort(reason?, options?) helper for each processor; when the processor calls abort() without a reason, this default message is thrown as a TripWire tagged with the processor's id. It signals the processor deliberately stopped the run, but gave no explanation.

Source

Thrown at packages/core/src/processors/runner.ts:511

    retryCount,
    rotateResponseMessageId,
  }: {
    workflow: ProcessorWorkflow;
    messageList: MessageList;
    stepNumber: number;
    steps: Array<StepResult<any>>;
    requestContext?: RequestContext;
    writer?: ProcessorStreamWriter;
    memory?: MastraMemory;
    resourceId?: string;
    threadId?: string;
    abortSignal?: AbortSignal;
    retryCount: number;
    rotateResponseMessageId?: () => string;
  }): Promise<void> {
    for (const processor of workflow.__stateSignalProcessors ?? []) {
      const abort = <TMetadata = unknown>(reason?: string, options?: TripWireOptions<TMetadata>): never => {
        throw new TripWire(reason || `Tripwire triggered by ${processor.id}`, options, processor.id);
      };

      await this.runComputeStateSignal({
        processor,
        messageList,
        stepNumber,
        steps,
        requestContext,
        writer,
        abort,
        processorState: this.getProcessorState(processor.id),
        memory,
        resourceId,
        threadId,
        abortSignal,
        retryCount,
        rotateResponseMessageId,
      });

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Find the processor named in the TripWire (processor.id) and pass a descriptive reason to abort('why').
  2. Handle the TripWire in your agent/run code (catch and inspect tripwire.processorId/retry/metadata).
  3. If the abort is unintentional, fix the processor's condition that triggers it.
  4. Add metadata to the abort options so downstream handlers can act on structured data.

Example fix

// before
abort();
// after
abort('Input flagged by moderation policy', { retry: false, metadata: { score } });
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await agent.generate(input);
} catch (e) {
  if (e?.name === 'TripWire') {
    console.error(`Processor ${e.processorId} aborted without a reason`);
    // route to fallback behavior or surface to user
  } else throw e;
}

Prevention

When it happens

Trigger: A processor's computeStateSignal implementation calls abort() (or abort(undefined, someOptions)) — i.e. a deliberate tripwire with no reason string — executed via runComputeStateSignal during runWorkflowComputeStateSignals or runProcessInputStep.

Common situations: Custom processors that call abort() conditionally but omit the reason argument; third-party processors with incomplete abort handling; content-moderation processors rejecting input without messaging.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/97aa9171ad2f0230. Report an issue: GitHub.