{"record":{"id":"917e7a3ed9c7153d","repo":"mastra-ai/mastra","slug":"processor-processor-id-computestatesignal-req","errorCode":null,"errorMessage":"[Processor:${processor.id}] computeStateSignal requires Mastra memory with an active resourceId and threadId","messagePattern":"\\[Processor:(.+?)\\] computeStateSignal requires Mastra memory with an active resourceId and threadId","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/processors/runner.ts","lineNumber":388,"sourceCode":"    abort: (reason?: string, options?: TripWireOptions) => never;\n    processorState: ProcessorState;\n    memory?: MastraMemory;\n    resourceId?: string;\n    threadId?: string;\n    abortSignal?: AbortSignal;\n    retryCount: number;\n    rotateResponseMessageId?: () => string;\n  }): Promise<void> {\n    const computeStateSignal = processor.computeStateSignal?.bind(processor);\n    if (!computeStateSignal) return;\n\n    const memoryContext = parseMemoryRequestContext(requestContext);\n    const resolvedMemory = memory;\n    const resolvedThreadId = threadId ?? memoryContext?.thread?.id;\n    const resolvedResourceId = resourceId ?? memoryContext?.resourceId;\n\n    if (!resolvedMemory) {\n      throw new Error(\n        `[Processor:${processor.id}] computeStateSignal requires Mastra memory with an active resourceId and threadId`,\n      );\n    }\n\n    // Memory is configured but this invocation has no thread/resource identity\n    // (e.g. an ephemeral workflow agent step). State signals are thread-scoped,\n    // so skip rather than throw.\n    if (!resolvedThreadId || !resolvedResourceId) {\n      this.logger.debug(\n        `[Processor:${processor.id}] computeStateSignal skipped — no threadId/resourceId resolved for this invocation`,\n      );\n      return;\n    }\n\n    const loadedThread = (await resolvedMemory.getThreadById({ threadId: resolvedThreadId })) ?? memoryContext?.thread;\n    if (!loadedThread) {\n      throw new Error(`[Processor:${processor.id}] computeStateSignal could not load thread ${resolvedThreadId}`);\n    }","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/processors/runner.ts#L370-L406","documentation":"runComputeStateSignal lets a processor emit state signals (abort/compute) that are thread-scoped via Mastra memory. If no memory instance is available in the invocation (resolvedMemory is undefined), the processor cannot scope state, so the runner throws. The message names the three requirements: Mastra memory, resourceId, threadId.","triggerScenarios":"A processor registered in __stateSignalProcessors runs through runWorkflowComputeStateSignals or runProcessInputStep in a context where no memory was passed and parseMemoryRequestContext(requestContext) yields nothing — e.g. ephemeral workflow agent steps with no thread/resource identity.","commonSituations":"Using a computeStateSignal-capable processor in a workflow without configuring agent memory; running processors in a stateless API route without threadId/resourceId in the request context; forgetting to pass memory to the agent/processor run options.","solutions":["Configure memory on the agent (or pass memory in run options) so state signals have storage to work with.","Supply threadId and resourceId in the request context or run options when invoking the workflow.","Remove the computeStateSignal processor from workflows that are intentionally ephemeral/stateless.","Upgrade @mastra/core if you expect memory from requestContext to be picked up but it is not."],"exampleFix":"// before\nmastra.getWorkflow('wf').execute({ inputData }); // no memory/thread\n// after\nawait agent.stream('input', { memory: { thread: 'thread-1', resource: 'user-1' } });","handlingStrategy":"validation","validationCode":"function assertStateSignalContext({ memory, threadId, resourceId }) {\n  if (!memory) throw new Error('computeStateSignal processors require a memory instance');\n  if (!threadId || !resourceId) throw new Error('computeStateSignal requires threadId and resourceId');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await run(input, options);\n} catch (e) {\n  if (e?.message?.includes('computeStateSignal requires Mastra memory')) {\n    // re-run with memory + thread/resource identifiers, or drop the processor\n  } else throw e;\n}","preventionTips":["Always configure memory when using state-signal processors.","Pass threadId/resourceId explicitly in run options or request context.","Keep ephemeral workflows free of thread-scoped processors."],"tags":["processors","memory","configuration","state-signal"],"backgroundTag":"missing-memory-context","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}