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
- Inspect the returned message for which setup step threw
- Ensure args is a plain object and the log object implements info/error/success/debug methods
- Re-check custom overrides of path-utils or utils that might throw instead of returning null
- 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
- Pass a proper args object and a compliant logger to the direct function
- Do not override path-utils/utils modules with throwing implementations
- Test the wrapper with minimal valid args to catch setup regressions early
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
- CORE_FUNCTION_ERROR
- CORE_FUNCTION_ERROR
- DIRECT_FUNCTION_SETUP_ERROR
- UPDATE_TASK_CORE_ERROR
- UPDATE_TASKS_CORE_ERROR
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/90d8dc74e3a22f40.
Report an issue: GitHub.