Fix: MCP log errors (#648)

This commit is contained in:
Ralph Khreish
2025-06-03 01:09:29 +02:00
committed by GitHub
parent ad612763ff
commit 9b4168bb4e
24 changed files with 226 additions and 218 deletions

View File

@@ -29,8 +29,7 @@ export async function setTaskStatusDirect(args, log) {
log.error(errorMessage);
return {
success: false,
error: { code: 'MISSING_ARGUMENT', message: errorMessage },
fromCache: false
error: { code: 'MISSING_ARGUMENT', message: errorMessage }
};
}
@@ -41,8 +40,7 @@ export async function setTaskStatusDirect(args, log) {
log.error(errorMessage);
return {
success: false,
error: { code: 'MISSING_TASK_ID', message: errorMessage },
fromCache: false
error: { code: 'MISSING_TASK_ID', message: errorMessage }
};
}
@@ -52,8 +50,7 @@ export async function setTaskStatusDirect(args, log) {
log.error(errorMessage);
return {
success: false,
error: { code: 'MISSING_STATUS', message: errorMessage },
fromCache: false
error: { code: 'MISSING_STATUS', message: errorMessage }
};
}
@@ -82,8 +79,7 @@ export async function setTaskStatusDirect(args, log) {
taskId,
status: newStatus,
tasksPath: tasksPath // Return the path used
},
fromCache: false // This operation always modifies state and should never be cached
}
};
// If the task was completed, attempt to fetch the next task
@@ -126,8 +122,7 @@ export async function setTaskStatusDirect(args, log) {
error: {
code: 'SET_STATUS_ERROR',
message: error.message || 'Unknown error setting task status'
},
fromCache: false
}
};
} finally {
// ALWAYS restore normal logging in finally block
@@ -145,8 +140,7 @@ export async function setTaskStatusDirect(args, log) {
error: {
code: 'SET_STATUS_ERROR',
message: error.message || 'Unknown error setting task status'
},
fromCache: false
}
};
}
}