mastra-ai/mastra · warning · TripWire
Stream part blocked by ${processor.id}
Error message
Stream part blocked by ${processor.id} What it means
This TripWire is thrown when a processor's processOutputStream calls the abort() helper for an individual stream chunk. It blocks that stream part (and can trip the whole stream depending on tripwireOptions). The generic message appears because the processor called abort() without a custom reason.
Source
Thrown at packages/core/src/processors/runner.ts:906
state = new ProcessorState<OUTPUT>({
processorName: processor.name ?? processor.id,
...observabilityContext,
processorIndex: index,
createSpan: true,
});
processorStates.set(processor.id, state);
}
// Track input chunk (before processor transformation)
state.addInputPart(processedPart);
const result = await processor.processOutputStream({
part: processedPart as ChunkType,
streamParts: state.streamParts as ChunkType[],
state: state.customState,
agent: this.agent,
abort: <TMetadata = unknown>(reason?: string, options?: TripWireOptions<TMetadata>): never => {
throw new TripWire(reason || `Stream part blocked by ${processor.id}`, options, processor.id);
},
...createObservabilityContext({ currentSpan: state.span }),
requestContext,
messageList,
retryCount,
writer,
});
// Track output chunk and update processedPart
processedPart = result as ChunkType<OUTPUT> | null | undefined;
state.addOutputPart(processedPart);
}
} catch (error) {
if (error instanceof TripWire) {
// Error span for trip-wire abort so it shows as ERROR in traces
const state = processorStates.get(processor.id);
state?.span?.error({
error,View on GitHub (pinned to 75dd419e61)
Solutions
- Inspect the thrown TripWire's processorId to find the offending processor.
- Pass a specific reason to abort(), e.g. abort('Blocked token stream: policy hit').
- Adjust or remove the stream processor if blocking is not intended; check its tripwireOptions for blocking scope.
- Catch TripWire in stream error handling if mid-stream aborts are expected.
Example fix
// before
processOutputStream: async ({ part, abort }) => {
if (isBad(part)) abort();
return part;
}
// after
processOutputStream: async ({ part, abort }) => {
if (isBad(part)) abort('Stream chunk blocked by profanity-filter', { suppress: true });
return part;
} Defensive patterns
Strategy: try-catch
Validate before calling
// Review stream processors for abort() without reason before deploying:
const audit = (p) => p.processOutputStream?.toString().includes('abort()') ? warn(p) : ok(p); Type guard
function isTripWire(e: unknown): e is TripWire {
return e instanceof TripWire;
} Try / catch
try {
for await (const chunk of stream) handle(chunk);
} catch (e) {
if (isTripWire(e)) {
console.warn('Stream part blocked by processor:', e.processorId, e.message);
} else throw e;
} Prevention
- Pass a reason to abort() in processOutputStream
- Decide blocking scope via TripWireOptions explicitly
- Test stream processors with chunk-level fixtures
- Monitor blocked-stream telemetry keyed by processorId
When it happens
Trigger: A stream processor inspecting each ChunkType via processOutputStream calls abort() when a chunk violates policy (e.g. streaming output containing banned words), without providing a reason string.
Common situations: Token-level moderation during streaming; redaction processors aborting mid-stream; debugging blocked streams where the generic message obscures which check fired.
Related errors
- ${tripwireChunk.payload?.reason || 'Agent tripwire triggered
- Aborted by processor
- No result received from agent execution on iteration ${itera
- No result received from agent execution
- AGENT_STREAM_V2_MODEL_NOT_SUPPORTED
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/56cc2fc6216461c4.
Report an issue: GitHub.