mastra-ai/mastra · error · Error

Subconscious capture shares the Observer model and does not

Error message

Subconscious capture shares the Observer model and does not accept model or maxSteps.

What it means

The built-in 'capture' observation agent deliberately reuses the Observer's model and step budget; allowing per-entry overrides would contradict that design. If a capture entry object contains a 'model' or 'maxSteps' key, the constructor rejects it during #validateObservationEntry.

Source

Thrown at packages/memory/src/processors/observational-memory/subconscious/index.ts:201

            includePreviousExtraction: false,
            onExtracted: custom.onExtracted,
          }),
        );
      }
    }
    return extractors;
  }

  #validateObservationEntry(entry: SubconsciousObservationEntry): void {
    const name = entryName(entry);
    if (typeof entry === 'string') {
      if (!BUILT_IN_OBSERVATION.has(name)) throw new Error(`Unknown Subconscious observation agent: ${name}`);
      return;
    }
    if (BUILT_IN_OBSERVATION.has(name)) {
      if (name === 'capture') {
        if ('model' in entry || 'maxSteps' in entry) {
          throw new Error('Subconscious capture shares the Observer model and does not accept model or maxSteps.');
        }
        if (
          'schema' in entry &&
          entry.schema &&
          (!('onExtracted' in entry) || typeof entry.onExtracted !== 'function')
        ) {
          throw new Error('A custom capture schema requires an onExtracted hook that handles its output.');
        }
      }
      return;
    }
    if ('model' in entry || 'maxSteps' in entry) {
      throw new Error(
        `Subconscious observation extractor "${name}" shares the Observer model and does not accept model or maxSteps.`,
      );
    }
    if (!('schema' in entry) || !entry.schema || !('onExtracted' in entry) || typeof entry.onExtracted !== 'function') {
      throw new Error(`Custom Subconscious observation agent "${name}" requires schema and onExtracted.`);

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Remove the model and maxSteps keys from the capture entry.
  2. Configure the model/maxSteps on the Observer (the shared configuration) instead.
  3. If a different model is truly needed, create a custom observation extractor object with schema + onExtracted instead of using built-in capture.

Example fix

// before
new Subconscious({ observation: [{ name: 'capture', model: 'gpt-4o', maxSteps: 3 }] });
// after
new Subconscious({ observer: { model: 'gpt-4o' }, observation: [{ name: 'capture' }] });
Defensive patterns

Strategy: validation

Validate before calling

const capture = { name: 'capture', model: m };
if ('model' in capture || 'maxSteps' in capture) {
  throw new Error('capture inherits the Observer model; move model/maxSteps to observer config');
}

Type guard

function isPlainCaptureEntry(e: object): boolean {
  return !('model' in e) && !('maxSteps' in e);
}

Try / catch

try {
  sub = new Subconscious({ observation: [entry] });
} catch (e) {
  if (e instanceof Error && e.message.includes('capture shares the Observer model')) {
    entry = { name: 'capture' };
    sub = new Subconscious({ observation: [entry] });
  } else throw e;
}

Prevention

When it happens

Trigger: new Subconscious({ observation: [{ name: 'capture', model: someModel }] }) or { name: 'capture', maxSteps: 5 }. Any capture entry object containing those keys.

Common situations: Copy-pasting a custom-extractor config onto the capture entry; assuming capture can run on a cheaper model; migrating config from a custom extractor entry to capture while keeping model/maxSteps fields.

Understand the failure class

Background: "Invalid configuration value" and "Unsupported/Unknown setting value" errors: why libraries reject your config strings, numbers, and types — this error's family across 30 libraries.

Related errors


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