{"record":{"id":"e01933988676e2c1","repo":"eyaltoledano/claude-task-master","slug":"file-storage-does-not-support-expandtaskwithprompt","errorCode":null,"errorMessage":"File storage does not support expandTaskWithPrompt. Client-side AI logic must process the expansion before calling updateTask().","messagePattern":"File storage does not support expandTaskWithPrompt\\. Client-side AI logic must process the expansion 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":442,"sourceCode":"\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}\n\t): Promise<void> {\n\t\tthrow new Error(\n\t\t\t'File storage does not support expandTaskWithPrompt. ' +\n\t\t\t\t'Client-side AI logic must process the expansion before calling updateTask().'\n\t\t);\n\t}\n\n\t/**\n\t * Update task or subtask status by ID - handles file storage logic with parent/subtask relationships\n\t */\n\tasync updateTaskStatus(\n\t\ttaskId: string,\n\t\tnewStatus: TaskStatus,\n\t\ttag?: string\n\t): Promise<UpdateStatusResult> {\n\t\tconst tasks = await this.loadTasks(tag);\n\n\t\t// Check if this is a subtask (contains a dot)\n\t\tif (taskId.includes('.')) {\n\t\t\treturn this.updateSubtaskStatusInFile(tasks, taskId, newStatus, tag);","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/storage/adapters/file-storage/file-storage.ts#L424-L460","documentation":"Like updateTaskWithPrompt, expandTaskWithPrompt() requires AI processing that the local FileStorage adapter cannot perform. Expansion of a task into subtasks must be computed by client-side AI logic (or an AI-enabled backend); the file adapter only supports persisting the expanded result via updateTask().","triggerScenarios":"Invoking storage.expandTaskWithPrompt() while using FileStorage, e.g. an 'expand' CLI/UI code path that assumes an AI-capable backend, or shared storage-abstraction code calling prompt methods unconditionally.","commonSituations":"Migrating from a remote/API storage adapter to file storage without updating expand flows, or automated scripts calling the expansion API on a purely local setup.","solutions":["Gate the call behind an adapter-capability check","Generate subtasks via your own AI provider client-side, then persist with updateTask() including the new subtasks","Choose a storage adapter that supports prompt-based expansion","Catch the error and route to a manual expansion workflow"],"exampleFix":"// before\nawait storage.expandTaskWithPrompt('3', 'break into steps', { numSubtasks: 4 });\n// after\nconst subtasks = await aiProvider.expandTask('3', 'break into steps', 4);\nconst task = tasks.find((t) => t.id === 3);\nawait storage.updateTask('3', { ...task, subtasks });","handlingStrategy":"fallback","validationCode":"function supportsPromptExpansion(s: unknown): boolean {\n  return !(s instanceof FileStorage); // FileStorage always throws for expandTaskWithPrompt\n}\nif (!supportsPromptExpansion(storage)) { /* expand client-side */ }","typeGuard":"function isUnsupportedExpandError(e: unknown): e is Error {\n  return e instanceof Error && e.message.includes('does not support expandTaskWithPrompt');\n}","tryCatchPattern":"try {\n  await storage.expandTaskWithPrompt(id, prompt, { numSubtasks: 4 });\n} catch (e) {\n  if (isUnsupportedExpandError(e)) {\n    const subtasks = await aiProvider.expandTask(id, prompt, 4);\n    const task = (await storage.loadTasks()).find((t) => String(t.id) === String(id));\n    await storage.updateTask(id, { ...task, subtasks });\n  } else throw e;\n}","preventionTips":["Gate expansion flows behind adapter capability checks","Generate subtasks with your AI provider client-side and persist via updateTask()","Keep storage-agnostic code free of prompt-method calls on file adapters","Test expand flows with FileStorage in CI to catch unsupported calls early"],"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"}