From 4635e73d0b33a0148c24e60e664edf47919de1ad Mon Sep 17 00:00:00 2001 From: Aditya kumar singh <143548997+Adityakk9031@users.noreply.github.com> Date: Sun, 19 Jul 2026 00:58:39 +0530 Subject: [PATCH] fix: ensure POSIX path serialization for workflow scriptPath on Windows ### Description This PR addresses an issue where Claude-style Workflow tool payloads fail to resolve correctly when dispatched from a Windows host. Previously, `Workflow.native_input()` serialized the `scriptPath` using `str(self.script_path)`, which evaluates to backslash-separated paths on Windows (e.g., `workflows\audit-routes.js`). When sent to the Claude API backend, these backslashes are often interpreted as literal characters in a filename rather than directory separators, causing workflow scripts to fail to load. This change updates the serialization to explicitly use `self.script_path.as_posix()`, enforcing forward slashes on all operating systems and ensuring seamless compatibility with cloud APIs. ### Testing - [x] Verified that `pytest tests/test_workflows.py::test_file_workflow_requires_native_workflow_feature` now passes on Windows, confirming the correct payload structure is generated. ### Related Issues Fixes #[Insert Issue Number Here] --- src/yoke/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yoke/models.py b/src/yoke/models.py index abb5d34..9dda41a 100644 --- a/src/yoke/models.py +++ b/src/yoke/models.py @@ -893,7 +893,7 @@ def native_input(self) -> dict[str, Any]: if self.native_name is not None: data["name"] = self.native_name if self.script_path is not None: - data["scriptPath"] = str(self.script_path) + data["scriptPath"] = self.script_path.as_posix() if self.args is not None: data["args"] = self.args if self.resume_from_run_id is not None: