Skip to content

[QUALITY-818] Fix Windows path separator issue in skill path normalization#12281

Merged
szgupta merged 3 commits into
masterfrom
warp1/quality-818-read_skill-tool-generates-path-with-double-leading-slash
Jun 9, 2026
Merged

[QUALITY-818] Fix Windows path separator issue in skill path normalization#12281
szgupta merged 3 commits into
masterfrom
warp1/quality-818-read_skill-tool-generates-path-with-double-leading-slash

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description

The read_skill tool was generating paths with double leading slashes (e.g. //workspace/...). The normalization code used PathBuf::from(&path).components().collect() to collapse them, but this approach has two problems on Windows:

  1. Backslash conversionPathBuf::components().collect() re-serialises paths using the platform separator, so /path/to/file becomes \path\to\file on Windows.
  2. UNC path misinterpretation — On Windows, //prefix/share is parsed as a UNC network path, so //workspace/common-skills/... became \\workspace\common-skills\... instead of /workspace/common-skills/....

Fix: Replaced PathBuf::components().collect() with a string-level collapse_slashes() helper that deduplicates consecutive / characters. Skill paths are always POSIX-style forward-slash paths on all platforms, so string-level normalisation is both correct and portable.

This fixes 5 failing tests in the Windows CI job (Run Windows tests):

  • local_origin_normalizes_double_leading_slash
  • local_origin_normalizes_multiple_slashes
  • local_origin_preserves_normal_absolute_path
  • read_skill_ref_with_local_origin_normalizes_double_slash
  • restored_display_origin_normalizes_double_leading_slash

Linked Issue

https://linear.app/warpdev/issue/QUALITY-818

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

The 5 previously failing tests now pass. No manual testing needed as this is a Windows-only path normalization fix for an internal data structure.

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Warp conversation: https://staging.warp.dev/conversation/4bad3814-2e1c-4e9b-ac79-c654400c148b

…e misses

When the LLM generates a skill path with duplicate leading slashes
(e.g. //workspace/...), PathBuf::from() preserves them verbatim,
causing the skill cache lookup to fail since cached keys use
filesystem-normalized single-slash paths.

Fix by collecting path components when constructing local paths in
SkillPathOrigin::location_for_path(), which collapses duplicate
separators (//workspace/... → /workspace/...).

Fixes: QUALITY-818

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 5, 2026
@szgupta szgupta requested a review from peicodes June 5, 2026 22:42
@szgupta szgupta marked this pull request as ready for review June 5, 2026 22:42
@oz-for-oss

oz-for-oss Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@szgupta

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR normalizes local skill paths during API-to-client conversion so duplicate separators such as //workspace/... produce the same local cache key as filesystem-derived skill paths. The added tests cover local and restored-display origins plus the read_skill reference conversion path.

Concerns

  • No blocking correctness, security, or spec-drift concerns found in the changed hunks.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

szgupta and others added 2 commits June 9, 2026 12:59
…ead_skill-tool-generates-path-with-double-leading-slash
PathBuf::components().collect() re-serialises paths using platform-specific
separators, which causes two problems on Windows:
- Forward slashes become backslashes
- Leading // is treated as a UNC path prefix (e.g. //workspace/share
  becomes \\workspace\share instead of /workspace)

Replace with a string-level collapse_slashes() helper that deduplicates
consecutive '/' characters. Skill paths are always POSIX-style forward-slash
paths on all platforms, so string-level normalisation is both correct and
portable.

Fixes 5 failing Windows CI tests in skills::conversion::conversion_tests.

Co-Authored-By: Oz <oz-agent@warp.dev>
@szgupta szgupta changed the title fix: normalize local paths in read_skill to prevent double-slash cache misses [QUALITY-818] Fix Windows path separator issue in skill path normalization Jun 9, 2026
@szgupta szgupta enabled auto-merge (squash) June 9, 2026 17:14
@szgupta szgupta merged commit 362f17a into master Jun 9, 2026
30 checks passed
@szgupta szgupta deleted the warp1/quality-818-read_skill-tool-generates-path-with-double-leading-slash branch June 9, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants