eyaltoledano/claude-task-master · error · Error

${result.message} || Update failed for task ${taskId}. The s

Error message

${result.message} || Update failed for task ${taskId}. The server did not provide details.

What it means

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.

Source

Thrown at packages/tm-core/src/modules/storage/adapters/api-storage.ts:604

		tag?: string,
		options?: { useResearch?: boolean; mode?: 'append' | 'update' | 'rewrite' }
	): Promise<void> {
		await this.ensureInitialized();

		const mode = options?.mode ?? 'append';

		try {
			// Use the API client - all auth, error handling, etc. is centralized
			const apiClient = this.getApiClient();

			const result = await apiClient.patch<UpdateTaskWithPromptResponse>(
				`/ai/api/v1/tasks/${taskId}/prompt`,
				{ prompt, mode }
			);

			if (!result.success) {
				// API returned success: false
				throw new Error(
					result.message ||
						`Update failed for task ${taskId}. The server did not provide details.`
				);
			}

			// Log success with task details
			this.logger.info(
				`Successfully updated task ${result.task.displayId || result.task.id} using AI prompt (mode: ${mode})`
			);
			this.logger.info(`  Title: ${result.task.title}`);
			this.logger.info(`  Status: ${result.task.status}`);
			if (result.message) {
				this.logger.info(`  ${result.message}`);
			}
		} catch (error) {
			// If it's already a TaskMasterError, just add context and re-throw
			if (error instanceof TaskMasterError) {
				throw error.withContext({

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Read the thrown message — it is the server's explanation; fix the prompt or task state it describes
  2. Check the taskId exists and is in an editable status before prompting
  3. Retry later if the backend AI service is degraded (check status)
  4. Ensure the prompt is non-empty and within size limits
  5. If the message is the generic fallback, enable verbose logging or check backend logs for details

Example fix

// before
await storage.updateTaskWithPrompt(id, '');
// after
if (!prompt.trim()) throw new Error('Prompt must not be empty');
try { await storage.updateTaskWithPrompt(id, prompt); }
catch (e) { console.error('Server said:', e.message); }
Defensive patterns

Strategy: try-catch

Validate before calling

if (!prompt || !prompt.trim()) throw new Error('Prompt must be a non-empty string');
const task = await storage.getTask(taskId);
if (!task) throw new Error(`Task ${taskId} not found before prompt update`);

Try / catch

try {
  await storage.updateTaskWithPrompt(taskId, prompt, tag, { mode: 'append' });
} catch (e) {
  // message is the server-provided explanation
  console.error(`AI update rejected: ${e.message}`);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/3329e8906a2ed814. Report an issue: GitHub.