{"record":{"id":"da3646153b285a28","repo":"mastra-ai/mastra","slug":"acpagent-does-not-support-resuming-suspended-gener","errorCode":null,"errorMessage":"AcpAgent does not support resuming suspended generate calls","messagePattern":"AcpAgent does not support resuming suspended generate calls","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent-sdks/acp/src/agent.ts","lineNumber":119,"sourceCode":"    const text = await this.connection.prompt(\n      prompt,\n      (options as { abortSignal?: AbortSignal } | undefined)?.abortSignal,\n    );\n    const messageList = this.createMessageList(messages, text);\n\n    return {\n      text,\n      response: {\n        dbMessages: messageList.get.response.db(),\n      },\n      toolResults: [],\n      finishReason: 'stop',\n      runId: options?.runId ?? randomUUID(),\n    };\n  }\n\n  async resumeGenerate(): Promise<SubAgentGenerateResult> {\n    throw new Error('AcpAgent does not support resuming suspended generate calls');\n  }\n\n  async resumeStream(): Promise<SubAgentStreamResult> {\n    throw new Error('AcpAgent does not support resuming suspended stream calls');\n  }\n\n  async stream(messages: MessageListInput, options?: AgentStreamOptions): Promise<SubAgentStreamResult> {\n    const runId = options?.runId ?? randomUUID();\n    const prompt = this.getPrompt(messages, options?.instructions);\n    const signal = (options as { abortSignal?: AbortSignal } | undefined)?.abortSignal;\n    const messageList = new MessageList();\n    messageList.add(messages, 'input');\n\n    let resolveText!: (text: string) => void;\n    let rejectText!: (error: unknown) => void;\n    const textPromise = new Promise<string>((resolve, reject) => {\n      resolveText = resolve;\n      rejectText = reject;","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/agent-sdks/acp/src/agent.ts#L101-L137","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nexport const mastra = new Mastra({ agents: { myAgent } });\n// after\nexport const mastra = new Mastra({\n  agents: { myAgent },\n  storage: new PostgresStore({ connectionString: process.env.DATABASE_URL }),\n});","handlingStrategy":"try-catch","validationCode":"const mastra = getMastra();\nif (!mastra?.getStorage?.()) {\n  throw new Error('Refusing to call agent-version endpoints: no storage configured on Mastra instance');\n}","typeGuard":"function hasStorage(m: unknown): m is { getStorage: () => object } {\n  return !!m && typeof (m as any).getStorage === 'function' && !!(m as any).getStorage();\n}","tryCatchPattern":"try {\n  await fetch(`/api/agents/${agentId}/versions/${versionId}`);\n} catch (e) {\n  if (isHttpError(e) && e.status === 500 && /Storage is not configured/.test(e.message)) {\n    // configure storage on the Mastra instance, then retry\n  } else throw e;\n}","preventionTips":["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"],"tags":["storage","configuration","server","http-500"],"backgroundTag":"storage-not-configured","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}