mastra-ai/mastra · error
ClaudeSDKAgent resumeData must include a message.
Error message
ClaudeSDKAgent resumeData must include a message.
What it means
In the restore handler, storage exists but getStore('agents') returns undefined, so the agents domain is unavailable and the handler throws this 500 HTTPException. Restoring a version requires reading and writing through the agents store.
Source
Thrown at agent-sdks/claude/src/index.ts:239
resumeData: ClaudeSDKAgentResumeData,
options?: ClaudeSDKAgentRunOptions<OUTPUT>,
): Promise<FullOutput<OUTPUT>> {
const data = validateClaudeResumeData(resumeData);
return this.generate(data.message, createClaudeResumeRunOptions(data, options));
}
async resumeStream<OUTPUT = undefined>(
resumeData: ClaudeSDKAgentResumeData,
options?: ClaudeSDKAgentRunOptions<OUTPUT>,
): Promise<MastraModelOutput<OUTPUT>> {
const data = validateClaudeResumeData(resumeData);
return this.stream(data.message, createClaudeResumeRunOptions(data, options));
}
}
function validateClaudeResumeData(resumeData: ClaudeSDKAgentResumeData): ClaudeSDKAgentResumeData {
if (!isRecord(resumeData) || !('message' in resumeData)) {
throw new Error('ClaudeSDKAgent resumeData must include a message.');
}
const hasSessionId = 'sessionId' in resumeData;
const hasContinue = 'continue' in resumeData;
if (hasSessionId && hasContinue) {
throw new Error('ClaudeSDKAgent resumeData must include either sessionId or continue: true, not both.');
}
if (hasSessionId) {
if (typeof resumeData.sessionId !== 'string') {
throw new Error('ClaudeSDKAgent resumeData.sessionId must be a string.');
}
return resumeData;
}
if (hasContinue) {
if (resumeData.continue !== true) {View on GitHub (pinned to 75dd419e61)
Solutions
- Use an official adapter that implements the agents store (Postgres, LibSQL, Upstash, etc.)
- Upgrade the storage adapter package to the latest compatible version
- Implement the agents domain (getStore('agents')) in custom adapters
- Verify @mastra/core and adapter versions are compatible
Example fix
// before
storage: new CustomPartialStorage() // missing agents domain
// after
storage: new PostgresStore({ connectionString: process.env.DATABASE_URL }) Defensive patterns
Strategy: type-guard
Validate before calling
const storage = mastra.getStorage();
const agentsStore = storage ? await storage.getStore('agents') : null;
if (!agentsStore) throw new Error('Agents domain unavailable in current storage adapter'); Type guard
function hasAgentsDomain(s: any): boolean {
return !!s && typeof s.getStore === 'function' && !!s.getStore && typeof s.getStore === 'function';
}
// usage: if (!hasAgentsDomain(storage)) swapAdapter(); Try / catch
try {
await restoreAgentVersion(agentId, versionId);
} catch (e) {
if (isHttpError(e) && e.status === 500 && /Agents storage domain is not available/.test(e.message)) {
// upgrade or replace the storage adapter
} else throw e;
} Prevention
- Pin adapter versions compatible with @mastra/core's agents store
- Run a bootstrap check that getStore('agents') resolves
- Prefer official adapters for versioning features
- Cover restore endpoints in integration tests with real adapters
When it happens
Trigger: Calling the agent-version restore endpoint when the active storage adapter does not implement the agents store.
Common situations: Custom or partial storage implementations; outdated adapter versions lacking the agents domain; adapter/core version mismatch after upgrades.
Related errors
- AcpAgent does not support resuming suspended stream calls
- AcpAgent does not support resuming suspended generate calls
- ACP prompt stopped before completing: ${response.stopReason}
- MCP clients storage domain is not available
- Memory storage was not available while storing the response
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/4d92e3df61e35571.
Report an issue: GitHub.