mastra-ai/mastra · error · MastraError

OBSERVABILITY_STORAGE_BATCH_CREATE_FEEDBACK_NOT_IMPLEMENTED

OBSERVABILITY_STORAGE_BATCH_CREATE_FEEDBACK_NOT_IMPLEMENTED

Error message

This storage provider does not support batch creating feedback

What it means

batchCreateFeedback writes many feedback observations in one call and is an optional provider capability; the base class throws rather than silently looping. This error means the storage adapter lacks a batch feedback implementation.

Source

Thrown at packages/core/src/storage/domains/observability/base.ts:669

  // ============================================================================

  /**
   * Creates a single feedback record.
   */
  async createFeedback(_args: CreateFeedbackArgs): Promise<void> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_CREATE_FEEDBACK_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support creating feedback',
    });
  }

  /**
   * Creates multiple feedback observations in a single batch.
   */
  async batchCreateFeedback(_args: BatchCreateFeedbackArgs): Promise<void> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_BATCH_CREATE_FEEDBACK_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support batch creating feedback',
    });
  }

  /**
   * Retrieves a list of feedback with optional filtering.
   */
  async listFeedback(_args: ListFeedbackArgs): Promise<ListFeedbackResponse> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_LIST_FEEDBACK_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support listing feedback',
    });
  }

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Switch to a provider implementing batch feedback writes (libsql, postgres, upstash).
  2. Implement batchCreateFeedback in your adapter (transactional multi-insert).
  3. Catch the error and fall back to looping createFeedback, or skip with a warning.
  4. Align adapter package version with the current core API.

Example fix

// before
await storage.batchCreateFeedback({ records: manyFeedbackRecords }); // throws
// after
try {
  await storage.batchCreateFeedback({ records: manyFeedbackRecords });
} catch (e) {
  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_BATCH_CREATE_FEEDBACK_NOT_IMPLEMENTED') {
    for (const r of manyFeedbackRecords) await storage.createFeedback(r);
    return;
  }
  throw e;
}
Defensive patterns

Strategy: fallback

Validate before calling

const supportsBatch = storage.constructor.prototype.hasOwnProperty('batchCreateFeedback');
if (!supportsBatch) { for (const r of records) await storage.createFeedback(r); return; }

Type guard

function canBatchFeedback(s: any): s is { batchCreateFeedback: (a: any) => Promise<void> } {
  return typeof s?.batchCreateFeedback === 'function' && s.constructor.prototype.hasOwnProperty('batchCreateFeedback');
}

Try / catch

try {
  await storage.batchCreateFeedback({ records });
} catch (e) {
  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_BATCH_CREATE_FEEDBACK_NOT_IMPLEMENTED') {
    await Promise.all(records.map(r => storage.createFeedback(r)));
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling storage.batchCreateFeedback({ records }) on an adapter extending the base without an override, or from evaluation pipelines importing bulk feedback into a minimal provider.

Common situations: Bulk-import scripts; eval harnesses persisting many feedback rows; custom adapters implementing only single-record writes (or none).

Related errors


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