Skip to content

fix(files): preserve slashes in folder paths - #6589

Merged
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/file-slash-name
Aug 12, 2026
Merged

fix(files): preserve slashes in folder paths#6589
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/file-slash-name

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve escaped slashes in workspace file folder paths
  • Use the shared path codec across API, VFS, ZIP, and client consumers
  • Verify other folder-backed resources already encode slash-containing names safely

Type of Change

  • Bug fix

Testing

  • bun run lint
  • bun run check:audits
  • bun run type-check
  • 146 targeted tests passing

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 12, 2026 3:05am

Request Review

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches foundational folder-path encoding across API, VFS, and file resolution; incorrect parsing could mis-resolve paths, though coverage is broad and behavior is additive for normal names.

Overview
Fixes workspace file folder paths so a slash inside a folder name is no longer treated as a hierarchy delimiter.

Introduces folder-display-path (\/ / \\ escaping) and switches path build/parse sites off naive .split('/') — covering folder storage, v2 file/folder APIs, VFS canonical paths, ZIP entries, file reference resolution, sidebar search, and optimistic renames. Public paths still percent-encode the slash (e.g. /Finance%2FLegal).

Also validates that a folder’s path’s last segment matches its name when presenting v2 folders.

Reviewed by Cursor Bugbot for commit a6ab404. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR introduces a shared escaped display-path codec and applies it across workspace-file APIs, VFS lookup, folder operations, ZIP generation, and client consumers.

  • Preserves slash-containing folder names as single canonical VFS segments.
  • Updates exact and in-memory file resolution to retain decoded segment boundaries.
  • Adds focused regression coverage for APIs, folder operations, VFS paths, and ZIP entries.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/workspace-files/folder-display-path.ts Adds the shared reversible codec that distinguishes escaped slashes and backslashes from hierarchy delimiters.
apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts Preserves decoded VFS segment boundaries through exact lookup and canonical in-memory matching, resolving the previously reported failure.
apps/sim/lib/copilot/vfs/path-utils.ts Builds canonical workspace-file paths from decoded display-path segments so slash-containing folder names remain atomic.
apps/sim/lib/copilot/tools/handlers/function-execute.ts Uses the shared codec when resolving tool input directories and constructing sandbox paths.
apps/sim/lib/uploads/zip-entry-path.ts Parses display paths before sanitization so embedded slashes are neutralized rather than treated as archive hierarchy.

Reviews (2): Last reviewed commit: "fix(files): resolve escaped folder looku..." | Re-trigger Greptile

Comment thread apps/sim/lib/copilot/vfs/path-utils.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a6ab404. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit f306b51 into staging Aug 12, 2026
30 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the fix/file-slash-name branch August 12, 2026 03:14
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.

1 participant