{"record":{"id":"3329e8906a2ed814","repo":"eyaltoledano/claude-task-master","slug":"result-message-update-failed-for-task-task","errorCode":null,"errorMessage":"${result.message} || Update failed for task ${taskId}. The server did not provide details.","messagePattern":"(.+?) \\|\\| Update failed for task (.+?)\\. The server did not provide details\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/storage/adapters/api-storage.ts","lineNumber":604,"sourceCode":"\t\ttag?: string,\n\t\toptions?: { useResearch?: boolean; mode?: 'append' | 'update' | 'rewrite' }\n\t): Promise<void> {\n\t\tawait this.ensureInitialized();\n\n\t\tconst mode = options?.mode ?? 'append';\n\n\t\ttry {\n\t\t\t// Use the API client - all auth, error handling, etc. is centralized\n\t\t\tconst apiClient = this.getApiClient();\n\n\t\t\tconst result = await apiClient.patch<UpdateTaskWithPromptResponse>(\n\t\t\t\t`/ai/api/v1/tasks/${taskId}/prompt`,\n\t\t\t\t{ prompt, mode }\n\t\t\t);\n\n\t\t\tif (!result.success) {\n\t\t\t\t// API returned success: false\n\t\t\t\tthrow new Error(\n\t\t\t\t\tresult.message ||\n\t\t\t\t\t\t`Update failed for task ${taskId}. The server did not provide details.`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Log success with task details\n\t\t\tthis.logger.info(\n\t\t\t\t`Successfully updated task ${result.task.displayId || result.task.id} using AI prompt (mode: ${mode})`\n\t\t\t);\n\t\t\tthis.logger.info(`  Title: ${result.task.title}`);\n\t\t\tthis.logger.info(`  Status: ${result.task.status}`);\n\t\t\tif (result.message) {\n\t\t\t\tthis.logger.info(`  ${result.message}`);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// If it's already a TaskMasterError, just add context and re-throw\n\t\t\tif (error instanceof TaskMasterError) {\n\t\t\t\tthrow error.withContext({","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/storage/adapters/api-storage.ts#L586-L622","documentation":"updateTaskWithPrompt throws a plain Error when the AI prompt-update endpoint responds with success:false. The message is the server-provided `result.message`, or a generic fallback noting the server gave no details. This is an application-level failure (the HTTP call itself succeeded) reported by the backend AI service.","triggerScenarios":"PATCH /ai/api/v1/tasks/{taskId}/prompt returns 2xx with body { success: false, message } — e.g. AI processing rejected the prompt, task in an uneditable state, or server-side AI quota/validation failure.","commonSituations":"Prompt violating backend content/rate limits; task locked or completed server-side; AI service degraded and returning structured failures; empty prompt sent in append mode.","solutions":["Read the thrown message — it is the server's explanation; fix the prompt or task state it describes","Check the taskId exists and is in an editable status before prompting","Retry later if the backend AI service is degraded (check status)","Ensure the prompt is non-empty and within size limits","If the message is the generic fallback, enable verbose logging or check backend logs for details"],"exampleFix":"// before\nawait storage.updateTaskWithPrompt(id, '');\n// after\nif (!prompt.trim()) throw new Error('Prompt must not be empty');\ntry { await storage.updateTaskWithPrompt(id, prompt); }\ncatch (e) { console.error('Server said:', e.message); }","handlingStrategy":"try-catch","validationCode":"if (!prompt || !prompt.trim()) throw new Error('Prompt must be a non-empty string');\nconst task = await storage.getTask(taskId);\nif (!task) throw new Error(`Task ${taskId} not found before prompt update`);","typeGuard":null,"tryCatchPattern":"try {\n  await storage.updateTaskWithPrompt(taskId, prompt, tag, { mode: 'append' });\n} catch (e) {\n  // message is the server-provided explanation\n  console.error(`AI update rejected: ${e.message}`);\n}\n","preventionTips":["Read the thrown message: it is the server's stated reason","Send non-empty, reasonably sized prompts","Verify the task is in an editable state before prompting","Retry later if the AI backend is degraded","Surface result.message to end users rather than swallowing it"],"tags":["api","ai","prompt","server-error"],"backgroundTag":"ai-prompt-update-rejected","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}