{"record":{"id":"4ab728ddaec67382","repo":"eyaltoledano/claude-task-master","slug":"file-storage-does-not-support-updatetaskwithprompt","errorCode":null,"errorMessage":"File storage does not support updateTaskWithPrompt. Client-side AI logic must process the prompt before calling updateTask().","messagePattern":"File storage does not support updateTaskWithPrompt\\. Client-side AI logic must process the prompt before calling updateTask\\(\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/storage/adapters/file-storage/file-storage.ts","lineNumber":422,"sourceCode":"\t\t\t...existingTask,\n\t\t\t...updates,\n\t\t\t...(mergedSubtasks && { subtasks: mergedSubtasks }),\n\t\t\tid: String(taskId) // Keep consistent with normalizeTaskIds\n\t\t};\n\t\tawait this.saveTasks(tasks, tag);\n\t}\n\n\t/**\n\t * Update task with AI-powered prompt\n\t * For file storage, this should NOT be called - client must handle AI processing first\n\t */\n\tasync updateTaskWithPrompt(\n\t\t_taskId: string,\n\t\t_prompt: string,\n\t\t_tag?: string,\n\t\t_options?: { useResearch?: boolean; mode?: 'append' | 'update' | 'rewrite' }\n\t): Promise<void> {\n\t\tthrow new Error(\n\t\t\t'File storage does not support updateTaskWithPrompt. ' +\n\t\t\t\t'Client-side AI logic must process the prompt before calling updateTask().'\n\t\t);\n\t}\n\n\t/**\n\t * Expand task into subtasks with AI-powered generation\n\t * For file storage, this should NOT be called - client must handle AI processing first\n\t */\n\tasync expandTaskWithPrompt(\n\t\t_taskId: string,\n\t\t_tag?: string,\n\t\t_options?: {\n\t\t\tnumSubtasks?: number;\n\t\t\tuseResearch?: boolean;\n\t\t\tadditionalContext?: string;\n\t\t\tforce?: boolean;\n\t\t}","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/storage/adapters/file-storage/file-storage.ts#L404-L440","documentation":"FileStorage is a local-file adapter and deliberately does not implement AI-driven task updating. updateTaskWithPrompt() is an unsupported operation for this backend: the caller (client-side AI logic) must process the prompt itself (e.g. via an AI provider) and then persist the result with the plain updateTask() method.","triggerScenarios":"Calling storage.updateTaskWithPrompt() on a FileStorage adapter instance, e.g. an app configured with file storage but invoking the AI-prompt API surface unconditionally, or code written against an API-backed storage adapter being reused with the file adapter.","commonSituations":"Switching storage backends from an API/AI-enabled adapter to local file storage without changing the update flow, or generic storage-agnostic code paths that call prompt-based methods without feature detection.","solutions":["Detect adapter capability before calling, or branch on storage type","Process the prompt with your AI integration client-side, then call updateTask() with the resulting task data","Use an AI-enabled storage/API adapter if prompt-driven updates are required","Wrap the call in a try/catch and fall back to manual updateTask() flow"],"exampleFix":"// before\nawait storage.updateTaskWithPrompt('5', 'add auth tests');\n// after\nconst result = await aiProvider.processTaskPrompt('5', 'add auth tests');\nawait storage.updateTask('5', result.updatedTask);","handlingStrategy":"fallback","validationCode":"// Feature-detect prompt support before calling\nfunction supportsPromptUpdate(s: unknown): boolean {\n  return typeof (s as FileStorage).updateTaskWithPrompt === 'function' &&\n    !(s instanceof FileStorage); // FileStorage always throws\n}\nif (!supportsPromptUpdate(storage)) { /* use manual AI + updateTask flow */ }","typeGuard":"function isUnsupportedPromptOpError(e: unknown): e is Error {\n  return e instanceof Error && e.message.includes('does not support updateTaskWithPrompt');\n}","tryCatchPattern":"try {\n  await storage.updateTaskWithPrompt(id, prompt);\n} catch (e) {\n  if (isUnsupportedPromptOpError(e)) {\n    const updated = await aiProvider.processTaskPrompt(id, prompt);\n    await storage.updateTask(id, updated);\n  } else throw e;\n}","preventionTips":["Check adapter capabilities before invoking prompt-based APIs","Centralize AI processing in client-side code, then persist via updateTask()","Document which storage adapter your flow requires","Add an integration test that exercises your update flow against FileStorage"],"tags":["unsupported-operation","storage","ai"],"backgroundTag":"unsupported-operation","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}