eyaltoledano/claude-task-master · error

DIRECT_FUNCTION_SETUP_ERROR

DIRECT_FUNCTION_SETUP_ERROR

Error message

error.message || 'Unknown setup error'

What it means

Outer catch in updateTaskByIdDirect wrapping everything before/around the core invocation setup: failures in argument destructuring, logger creation, silent-mode toggling, or unexpected throws outside the inner try are returned as DIRECT_FUNCTION_SETUP_ERROR.

Source

Thrown at mcp-server/src/core/direct-functions/update-task-by-id.js:187

			return {
				success: false,
				error: {
					code: 'UPDATE_TASK_CORE_ERROR',
					message: error.message || 'Unknown error updating task'
				}
			};
		} finally {
			if (!wasSilent && isSilentMode()) {
				disableSilentMode();
			}
		}
	} catch (error) {
		logWrapper.error(`Setup error in updateTaskByIdDirect: ${error.message}`);
		if (isSilentMode()) disableSilentMode();
		return {
			success: false,
			error: {
				code: 'DIRECT_FUNCTION_SETUP_ERROR',
				message: error.message || 'Unknown setup error'
			}
		};
	}
}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Inspect the returned message for which setup step threw
  2. Ensure args is a plain object and the log object implements info/error/success/debug methods
  3. Re-check custom overrides of path-utils or utils that might throw instead of returning null
  4. Re-run with a minimal args payload ({id, prompt, projectRoot}) to isolate the failing piece

Example fix

// before
await updateTaskByIdDirect(undefined, log);
// after
await updateTaskByIdDirect({ id: '5', prompt: 'x', projectRoot: '/proj' }, log);
Defensive patterns

Strategy: try-catch

Validate before calling

function argsAreWellFormed(args, log) {
  return typeof args === 'object' && args !== null &&
    log && ['info','error','success','debug'].every(m => typeof log[m] === 'function');
}

Type guard

function isLogger(o) {
  return typeof o === 'object' && o !== null &&
    typeof o.info === 'function' && typeof o.error === 'function';
}

Try / catch

const result = await updateTaskByIdDirect(args, log);
if (!result.success && result.error.code === 'DIRECT_FUNCTION_SETUP_ERROR') {
  console.error(`Setup failed: ${result.error.message}`);
  // check args shape, logger implementation, or overridden utils modules
}

Prevention

When it happens

Trigger: An exception thrown outside the inner try/catch (e.g. createLogWrapper failing, findTasksPath throwing instead of returning null, isSilentMode/enableSilentMode throwing) while executing updateTaskByIdDirect.

Common situations: Malformed args object (e.g. args is null); a logger that throws on .info/.error; a patched or broken path-utils module that throws during path discovery; environment issues in scripts/modules/utils.js imports.

Related errors


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