Skip to content

Commit da9db50

Browse files
committed
fix(workflows_mcp.engine.executors_file): allow base_path to be None and default to current directory
Changed the type of base_path to accept None and added a validator to default None values to '.' to handle explicit null inputs from agents gracefully.
1 parent 6de95ef commit da9db50

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/workflows_mcp/engine/executors_file.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,18 @@ class ReadFilesInput(BlockInput):
239239
max_length=50,
240240
)
241241

242-
base_path: str = Field(
242+
base_path: str | None = Field(
243243
default=".",
244244
description="Base directory to search from (relative or absolute). Used with patterns.",
245245
)
246246

247+
@field_validator("base_path", mode="before")
248+
@classmethod
249+
def _default_base_path(cls, v: Any) -> Any:
250+
if v is None:
251+
return "."
252+
return v
253+
247254
mode: Literal["full", "outline", "summary"] | str = Field(
248255
default="full",
249256
description=(

0 commit comments

Comments
 (0)