fix(file): strip Windows verbatim prefix from /api/fs/browse paths#453
Merged
Conversation
fs::canonicalize returns extended-length (verbatim) paths on Windows (\\?\C:\DEV), which the endpoint serialized verbatim into current_path, parent_path and item paths. The WebUI stored that string as the conversation workspace, breaking Claude Code spawning (cmd.exe shims reject verbatim working directories) and splitting the same directory into two project-list entries. Strip \\?\ and \\?\UNC\ prefixes at the response boundary; sandbox checks keep comparing canonical (verbatim) forms internally. Fixes iOfficeAI/AionUi#3191
4 tasks
piorpua
pushed a commit
that referenced
this pull request
Jun 11, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.28](v0.1.27...v0.1.28) (2026-06-11) ### Bug Fixes * **auth:** allow same-origin framing on office preview proxy routes ([#454](#454)) ([3543dbd](3543dbd)) * **file:** strip Windows verbatim prefix from /api/fs/browse paths ([#453](#453)) ([f8c3f95](f8c3f95)) * **stt:** STT compatibility fixes for Groq Whisper and AionUI web frontend ([#400](#400)) ([4c3fa09](4c3fa09)) * **stt:** treat blank base_url as unset and log malformed config ([#448](#448)) ([f6b653b](f6b653b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
iOfficeAI/AionUi#3191 — on Windows, selecting a directory in the WebUI picker stores paths like
\\?\C:\DEV\xxxxxas the conversation workspace. Claude Code then fails to connect (cmd.exe-based CLI shims reject verbatim working directories), and the same directory shows up as two different projects in the sidebar (C:\DEV\xxxxxfrom old sessions vs\\?\C:\DEV\xxxxxfrom new ones).Root cause
The
/api/fs/browseendpoint (added in #235, replacing the legacy Express implementation in AionUi) resolves paths withfs::canonicalize, which on Windows returns extended-length (verbatim) paths —\\?\C:\DEV. Those strings were serialized verbatim intocurrent_path,parent_pathand every itempath. The legacy Express endpoint built paths with Node'spath.joinand never produced this form, so this is an M6-cutover regression.Fix
Strip
\\?\(and\\?\UNC\→\\) at the response-serialization boundary inbrowse.rs. Internal sandbox checks keep comparing canonical (verbatim) forms, so the allow-list semantics are unchanged.Tests
#[cfg(windows)]end-to-end regression test asserting no response path carries the verbatim prefix (fails on Windows without this fix)cargo testfull workspace: 6022 passed; clippy-D warnings+ fmt cleanFrontend defensive counterpart: iOfficeAI/AionUi PR (renderer-side normalization for older backend binaries) follows.
Fixes iOfficeAI/AionUi#3191