Describe the bug
When using the Workflow feature on a Windows machine, the scriptPath sent to the Claude API backend is serialized using backslashes instead of forward slashes, causing the script to fail to resolve on the remote API endpoint.
In src/yoke/models.py, the Workflow.native_input() method constructs the payload that gets sent to Claude. It currently uses str(self.script_path) to serialize the path. On Windows, this generates paths with backslashes (e.g. workflows\audit-routes.js). Since backend APIs typically expect POSIX-style paths (forward slashes), the backend interprets the backslash as a literal character in the filename rather than a directory separator, resulting in a failure to locate the workflow script.
Steps to reproduce
- Run Yoke on a Windows machine.
- Attempt to execute a Workflow that defines a
script_path (e.g. Workflow(script_path=Path("workflows/audit-routes.js"))).
- The payload sent to the API contains
"scriptPath": "workflows\\audit-routes.js".
- The API fails to resolve the script path because of the backslash separator.
Expected behavior
The native_input() method should serialize script_path with forward slashes on all operating systems to maintain compatibility with the API.
Suggested Fix
Update native_input() in src/yoke/models.py to use .as_posix():
def native_input(self) -> dict[str, Any]:
"""Return Claude-style Workflow tool input fields."""
data: dict[str, Any] = {}
if self.script is not None and self.script.strip():
data["script"] = self.script
if self.native_name is not None:
data["name"] = self.native_name
if self.script_path is not None:
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:
data["resumeFromRunId"] = self.resume_from_run_id
return data
Describe the bug
When using the Workflow feature on a Windows machine, the
scriptPathsent to the Claude API backend is serialized using backslashes instead of forward slashes, causing the script to fail to resolve on the remote API endpoint.In
src/yoke/models.py, theWorkflow.native_input()method constructs the payload that gets sent to Claude. It currently usesstr(self.script_path)to serialize the path. On Windows, this generates paths with backslashes (e.g.workflows\audit-routes.js). Since backend APIs typically expect POSIX-style paths (forward slashes), the backend interprets the backslash as a literal character in the filename rather than a directory separator, resulting in a failure to locate the workflow script.Steps to reproduce
script_path(e.g.Workflow(script_path=Path("workflows/audit-routes.js")))."scriptPath": "workflows\\audit-routes.js".Expected behavior
The
native_input()method should serializescript_pathwith forward slashes on all operating systems to maintain compatibility with the API.Suggested Fix
Update
native_input()insrc/yoke/models.pyto use.as_posix():