{"record":{"id":"796da40f8ad36aa0","repo":"mastra-ai/mastra","slug":"resource-working-memory-is-not-implemented-by-this","errorCode":null,"errorMessage":"Resource working memory is not implemented by this storage adapter (${this.constructor.name}). This is likely a bug - all Mastra storage adapters should implement resource support. Please report this issue at https://github.com/mastra-ai/mastra/issues","messagePattern":"Resource working memory is not implemented by this storage adapter \\((.+?)\\)\\. This is likely a bug - all Mastra storage adapters should implement resource support\\. Please report this issue at https://github\\.com/mastra-ai/mastra/issues","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/memory/base.ts","lineNumber":192,"sourceCode":"   */\n  abstract listThreads(args: StorageListThreadsInput): Promise<StorageListThreadsOutput>;\n\n  /**\n   * Clone a thread and its messages to create a new independent thread.\n   * The cloned thread will have clone metadata stored in its metadata field.\n   *\n   * @param args - Clone configuration options\n   * @returns The newly created thread and the cloned messages\n   */\n  async cloneThread(_args: StorageCloneThreadInput): Promise<StorageCloneThreadOutput> {\n    throw new Error(\n      `Thread cloning is not implemented by this storage adapter (${this.constructor.name}). ` +\n        `The cloneThread method needs to be implemented in the storage adapter.`,\n    );\n  }\n\n  async getResourceById(_: { resourceId: string }): Promise<StorageResourceType | null> {\n    throw new Error(\n      `Resource working memory is not implemented by this storage adapter (${this.constructor.name}). ` +\n        `This is likely a bug - all Mastra storage adapters should implement resource support. ` +\n        `Please report this issue at https://github.com/mastra-ai/mastra/issues`,\n    );\n  }\n\n  async saveResource(_: { resource: StorageResourceType }): Promise<StorageResourceType> {\n    throw new Error(\n      `Resource working memory is not implemented by this storage adapter (${this.constructor.name}). ` +\n        `This is likely a bug - all Mastra storage adapters should implement resource support. ` +\n        `Please report this issue at https://github.com/mastra-ai/mastra/issues`,\n    );\n  }\n\n  async updateResource(_: {\n    resourceId: string;\n    workingMemory?: string;\n    metadata?: Record<string, unknown>;","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/memory/base.ts#L174-L210","documentation":"getResourceById's base-class default throws, and the message says this is likely a bug: per the framework contract, every storage adapter should implement resource (working memory) support. Hitting this means the loaded adapter subclass neither implements the method nor extends a base that does.","triggerScenarios":"Any working-memory/resource lookup path calling getResourceById against an adapter whose class does not override it — most plausibly a custom or third-party adapter missing the implementation, or an adapter from an older core version.","commonSituations":"Hand-rolled storage adapters; adapters from older versions predating the resource domain; subclassing MastraStorage directly for a quick mock store.","solutions":["Implement getResourceById in your adapter (return the resource row or null)","Update the adapter package to a version that implements resource support","File a bug with the official adapter per the linked issue tracker","Bypass working-memory features if using a stub store"],"exampleFix":"// before\nclass MyStore extends MastraStorage { /* no getResourceById */ }\n// after\nasync getResourceById({ resourceId }: { resourceId: string }): Promise<StorageResourceType | null> {\n  return this.db.resources.get(resourceId) ?? null;\n}","handlingStrategy":"try-catch","validationCode":"function supportsResources(storage: unknown): boolean {\n  return typeof (storage as any)?.getResourceById === 'function' &&\n    (storage as any).getResourceById !== (MastraStorage.prototype as any).getResourceById;\n}","typeGuard":"function canGetResource(s: unknown): s is { getResourceById(a: { resourceId: string }): Promise<StorageResourceType | null> } {\n  return supportsResources(s);\n}","tryCatchPattern":"try {\n  return await storage.getResourceById({ resourceId });\n} catch (e) {\n  if (e instanceof Error && e.message.includes('Resource working memory is not implemented')) {\n    logger.error('Storage adapter does not implement resources; update or fix the adapter');\n    return null;\n  }\n  throw e;\n}","preventionTips":["Subclass the correct concrete adapter base, not raw MastraStorage, for custom stores","Run a startup capability check on getResourceById and fail fast with a clear message","Keep adapter packages updated to a version implementing the resource domain"],"tags":["storage","unsupported-operation","working-memory","bug"],"backgroundTag":"method-not-implemented-by-adapter","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}