mastra-ai/mastra · error
AcpAgent does not support resuming suspended generate calls
Error message
AcpAgent does not support resuming suspended generate calls
What it means
The Mastra server handler for agent version operations requires a configured storage adapter. mastra.getStorage() returns undefined when no storage was configured on the Mastra instance, so the handler aborts with a 500 HTTPException. Agent versioning (list/get/restore) persists to storage and cannot run without it.
Source
Thrown at agent-sdks/acp/src/agent.ts:119
const text = await this.connection.prompt(
prompt,
(options as { abortSignal?: AbortSignal } | undefined)?.abortSignal,
);
const messageList = this.createMessageList(messages, text);
return {
text,
response: {
dbMessages: messageList.get.response.db(),
},
toolResults: [],
finishReason: 'stop',
runId: options?.runId ?? randomUUID(),
};
}
async resumeGenerate(): Promise<SubAgentGenerateResult> {
throw new Error('AcpAgent does not support resuming suspended generate calls');
}
async resumeStream(): Promise<SubAgentStreamResult> {
throw new Error('AcpAgent does not support resuming suspended stream calls');
}
async stream(messages: MessageListInput, options?: AgentStreamOptions): Promise<SubAgentStreamResult> {
const runId = options?.runId ?? randomUUID();
const prompt = this.getPrompt(messages, options?.instructions);
const signal = (options as { abortSignal?: AbortSignal } | undefined)?.abortSignal;
const messageList = new MessageList();
messageList.add(messages, 'input');
let resolveText!: (text: string) => void;
let rejectText!: (error: unknown) => void;
const textPromise = new Promise<string>((resolve, reject) => {
resolveText = resolve;
rejectText = reject;View on GitHub (pinned to 75dd419e61)
Solutions
- Configure storage on the Mastra instance, e.g. new Mastra({ storage: new PostgresStore({connectionString: process.env.DATABASE_URL}) })
- Verify the configured storage is actually passed to the server/builder that serves the handlers
- Confirm getStorage() is not shadowed by an environment-conditional that skips storage in production
- Rebuild/redeploy the server so the running instance includes storage
Example fix
// before
export const mastra = new Mastra({ agents: { myAgent } });
// after
export const mastra = new Mastra({
agents: { myAgent },
storage: new PostgresStore({ connectionString: process.env.DATABASE_URL }),
}); Defensive patterns
Strategy: try-catch
Validate before calling
const mastra = getMastra();
if (!mastra?.getStorage?.()) {
throw new Error('Refusing to call agent-version endpoints: no storage configured on Mastra instance');
} Type guard
function hasStorage(m: unknown): m is { getStorage: () => object } {
return !!m && typeof (m as any).getStorage === 'function' && !!(m as any).getStorage();
} Try / catch
try {
await fetch(`/api/agents/${agentId}/versions/${versionId}`);
} catch (e) {
if (isHttpError(e) && e.status === 500 && /Storage is not configured/.test(e.message)) {
// configure storage on the Mastra instance, then retry
} else throw e;
} Prevention
- Always configure storage in the Mastra constructor, even in dev (use in-memory adapter if needed)
- Add a startup assertion that mastra.getStorage() returns a value before serving traffic
- Keep storage config out of environment conditionals
- Include storage presence in health/readiness checks
When it happens
Trigger: Calling any agent-version HTTP endpoint (e.g. GET/POST /api/agents/:agentId/versions/:versionId) against a Mastra instance constructed without `storage: new MastraStorage(...)` in its options.
Common situations: Local/dev setups where storage was deliberately omitted; configuration stripped when refactoring; using a Mastra builder/server config that forgot the storage key; deploying a server bundle built from an instance that had storage only in dev conditionals.
Related errors
- ACP prompt stopped before completing: ${response.stopReason}
- Storage is not configured
- Storage is not configured
- AcpAgent does not support resuming suspended stream calls
- ClaudeSDKAgent resumeData must include a message.
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/da3646153b285a28.
Report an issue: GitHub.