Skip to content

agentfs: use forward slashes in Dockerfile entrypoint paths on Windows#842

Open
c-tonneslan wants to merge 1 commit intolivekit:mainfrom
c-tonneslan:fix/dockerfile-windows-paths
Open

agentfs: use forward slashes in Dockerfile entrypoint paths on Windows#842
c-tonneslan wants to merge 1 commit intolivekit:mainfrom
c-tonneslan:fix/dockerfile-windows-paths

Conversation

@c-tonneslan
Copy link
Copy Markdown

Fixes #761.

filepath.WalkDir returns OS-native paths, so on Windows the generated Dockerfile ends up with entries like:

RUN uv run "src\agent.py" download-files
CMD ["uv", "run", "src\agent.py", "start"]

The base image is always Linux, so those backslash paths don't work at runtime.

Fix: when collecting candidate entrypoint files, use filepath.Rel to make the path relative to the project directory, then filepath.ToSlash to normalize separators. All selection branches (auto, skip-prompts, interactive) now get a clean Unix-style path like src/agent.py.

filepath.WalkDir returns OS-native paths, so on Windows the entrypoint
ends up as something like src\agent.py in the generated Dockerfile.
Since the base image is Linux, those paths are invalid at runtime.

Fix by making the path relative to the project dir with filepath.Rel
and converting separators with filepath.ToSlash before adding to the
candidate list. This way all branches (auto-select, skip-prompts, and
interactive) get a clean Unix-style path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dockerfile generated by lk agent create uses Windows path separators

1 participant