CrewAI FileWriterTool keeps creating files in random locations in my project

Even though I’ve set (directory = ‘./output/’) in FileWriterTool and also specified given directories to create outputs in, based on the task itself, but it keeps putting them all over

Here’s the tool definition in the tools init file:

=============

from crewai_tools import FileReadTool, FileWriterTool, SerperDevTool, ScrapeWebsiteTool

fileReadTool = FileReadTool()
fileWriterTool = FileWriterTool(directory=“./output/”)
serperDevTool = SerperDevTool()
scrapeWebsiteTool = ScrapeWebsiteTool()

==============

And here is an example of a task definition both in crew.py and tasks.yaml that writes all-over:

crew.py =
@task
def scaffold_et_frontend(self) → Task:
return Task(
config=self.tasks_config[“scaffold_et_frontend”],
tools=[fileWriterTool, fileReadTool]
)

tasks.yaml =
scaffold_et_frontend:
description: >
Crée l’arborescence des fichiers React, routing, state management, structure, composants de base alignés aux tokens UI dont on aura besoin pour monter le projet.
Ne JAMAIS réécrire par dessus un fichier déjà existant, ajoute plutôt à la fin du document existant.
Ne JAMAIS lire ou écrire des fichiers dans d’autres répertoires que ceux spécifiés.
expected_output: >
- Plan d’arborescence de fichiers
output_file: output/docs/frontend_scaffold.md
agent: fullstack_dev
context: [planification_produit, ux_specifications]
human_input: false