{"record":{"id":"297c72f0ce3ac832","repo":"mastra-ai/mastra","slug":"tripwire-triggered-by-processor-id-297c72","errorCode":null,"errorMessage":"Tripwire triggered by ${processor.id}","messagePattern":"Tripwire triggered by (.+?)","errorType":"exception","errorClass":"TripWire","httpStatus":null,"severity":"warning","filePath":"packages/core/src/workflows/evented/workflow.ts","lineNumber":847,"sourceCode":"        steps,\n        usage,\n        messageId,\n        rotateResponseMessageId,\n        // toolResult phase fields\n        toolName,\n        toolCallId,\n        args: toolCallArgs,\n        toolResultValue,\n        providerExecuted,\n        // Shared processor states map for accessing persisted state\n        processorStates,\n        // Abort signal for cancelling in-flight processor work (e.g. OM observations)\n        abortSignal,\n      } = input;\n\n      // Create a minimal abort function that throws TripWire\n      const abort = (reason?: string, options?: { retry?: boolean; metadata?: unknown }): never => {\n        throw new TripWire(reason || `Tripwire triggered by ${processor.id}`, options, processor.id);\n      };\n      const initialMessageId = messageId;\n      let currentMessageId = messageId;\n      const rotateCurrentResponseMessageId = rotateResponseMessageId\n        ? () => {\n            currentMessageId = rotateResponseMessageId();\n            return currentMessageId;\n          }\n        : undefined;\n      const defaultOutputResult: OutputResult = {\n        text: '',\n        usage: { inputTokens: 0, outputTokens: 0, totalTokens: 0 },\n        finishReason: 'unknown',\n        steps: [],\n      };\n\n      const buildProcessorSpanInput = () => {\n        switch (phase) {","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workflows/evented/workflow.ts#L829-L865","documentation":"Within processor step execution, a local abort() helper throws a TripWire to signal that a processor halted the stream. The reason defaults to \"Tripwire triggered by <processor.id>\". This is the evented-workflow adapter re-raising a tripwire originating from a processor (abort can also be invoked on cancel).","triggerScenarios":"A processor calls the provided abort callback (or the run is cancelled) while a processor step is streaming; the message surfaces in the run's error/step output with the processor's id in the reason.","commonSituations":"Content moderation/guardrail processors aborting on policy violations; custom processors calling abort() without a custom reason; user cancelling the workflow run mid-processor.","solutions":["Treat this as an expected control-flow signal: catch TripWire and inspect reason/processor id instead of treating it as a crash.","Have the processor call abort('specific reason') so downstream consumers see why the tripwire fired.","If the abort is unexpected, review the processor's gating logic and input content that triggered it."],"exampleFix":"// before\ntry {\n  await workflow.start(...);\n} catch (e) {\n  throw e;\n}\n\n// after\ntry {\n  await workflow.start(...);\n} catch (e) {\n  if (e instanceof TripWire) {\n    console.warn('Processor halted run:', e.message);\n    return { aborted: true, reason: e.message };\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"const assertProcessorGates = (p: { id: string; abort?: Function }) => {\n  if (typeof p.abort !== 'function') {\n    console.warn(`Processor ${p.id} may abort; ensure callers handle TripWire`);\n  }\n};","typeGuard":"const isTripWire = (e: unknown): e is TripWire & { processorId?: string } =>\n  e instanceof TripWire;","tryCatchPattern":"try {\n  await run;\n} catch (e) {\n  if (isTripWire(e)) {\n    return { status: 'aborted', reason: e.reason, processor: (e as any).processorId };\n  }\n  throw e;\n}","preventionTips":["Always catch TripWire in code paths that run processors or can be cancelled.","Provide a descriptive reason when a processor calls abort().","Log tripwire events with the processor id for observability."],"tags":["processor","tripwire","guardrail","stream"],"backgroundTag":"processor-tripwire-triggered","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}