mastra-ai/mastra · error · Error
The threads.generateTitle option has been moved. Use the top
Error message
The threads.generateTitle option has been moved. Use the top-level generateTitle option instead.
What it means
The threads.generateTitle option was relocated to a top-level generateTitle option in Memory config. getMergedThreadConfig throws this Error when a config still nests generateTitle under threads, preventing silent misconfiguration after the API move.
Source
Thrown at packages/core/src/memory/memory.ts:388
if (indexConfig.ivf) createParams.indexConfig.ivf = indexConfig.ivf;
if (indexConfig.hnsw) createParams.indexConfig.hnsw = indexConfig.hnsw;
}
// Request btree indexes on metadata fields used for filtering
// This avoids sequential scans on large tables when querying by thread_id or resource_id
createParams.metadataIndexes = ['thread_id', 'resource_id'];
await this.vector.createIndex(createParams);
return { indexName };
}
public getMergedThreadConfig(config?: MemoryConfigInternal): MemoryConfigInternal {
if (config?.workingMemory && typeof config.workingMemory === 'object' && 'use' in config.workingMemory) {
throw new Error('The workingMemory.use option has been removed. Working memory always uses tool-call mode.');
}
if (config?.threads?.generateTitle !== undefined) {
throw new Error(
'The threads.generateTitle option has been moved. Use the top-level generateTitle option instead.',
);
}
const mergedConfig = deepMerge(this.threadConfig, config || {});
if (
typeof config?.workingMemory === 'object' &&
config.workingMemory?.schema &&
typeof mergedConfig.workingMemory === 'object'
) {
mergedConfig.workingMemory.schema = config.workingMemory.schema;
}
return mergedConfig;
}
estimateTokens(text: string): number {View on GitHub (pinned to 75dd419e61)
Solutions
- Move generateTitle from threads to the top level of your memory options.
- Search configs for 'threads' blocks containing generateTitle after upgrading.
- Consult current Mastra memory docs for the new generateTitle placement.
Example fix
// before
options: { threads: { generateTitle: true } }
// after
options: { generateTitle: true } Defensive patterns
Strategy: validation
Validate before calling
function assertNoNestedGenerateTitle(options) {
if (options?.threads && 'generateTitle' in options.threads) {
throw new Error('Move threads.generateTitle to top-level generateTitle');
}
} Type guard
function usesMovedGenerateTitle(cfg) {
return !!cfg?.threads && 'generateTitle' in cfg.threads;
} Prevention
- After upgrades, grep for threads: { generateTitle.
- Rely on TypeScript exhaustively typed Memory options to flag unknown nested fields.
- Follow current Mastra memory migration notes when bumping major versions.
When it happens
Trigger: Passing { threads: { generateTitle: true } } in Memory options or any config passed to getMergedThreadConfig.
Common situations: Upgrading across a Mastra version where generateTitle moved; following older documentation or tutorials; code generators emitting the old nested shape.
Related errors
- The 'processors' option in Memory is deprecated and has been
- The workingMemory.use option has been removed. Working memor
- toAISdkFormat() has been deprecated. Please use toAISdkStrea
- AGENT_MEMORY_THREAD_RESOURCE_MISMATCH
- addMessage is deprecated. Please use saveMessages instead.
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/df18707e97cb5c39.
Report an issue: GitHub.