fix(paths): accept Unicode working directories#163
Merged
Ark0N merged 1 commit intoJul 23, 2026
Conversation
Owner
|
Thank you as always for the contribution! Reviewed in detail: the Unicode property escapes widen only letters and numbers, every shell metacharacter stays excluded (fullwidth homoglyphs like ; are Unicode punctuation, so still rejected), and both defense layers on top of the pattern (isValidWorkingDir in schemas.ts and isValidPath in tmux-manager.ts) are untouched. Verified the regression test, typecheck, lint and format locally; CI is green. Merging. |
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.
Summary
Problem
SAFE_PATH_PATTERNonly allowed ASCII letters and numbers. Valid local directories such as/mnt/d/AI/中文项目were rejected byCreateSessionSchema,QuickRunSchema, andScheduledRunSchemabefore the server could check whether the directory existed. The UI consequently reportedInvalid request bodywhen creating or running a session from a non-ASCII working directory.Fix
Use Unicode property escapes for letters and numbers while retaining the existing explicit character allowlist and the
isValidWorkingDir()checks for absolute paths, traversal, and shell metacharacters.Validation
/mnt/d/AI/中文项目for Create Session, Quick Run, and Scheduled Runnpm test -- test/working-directory-schema.test.tsnpm run typechecknpm run lintnpm run check:frontend-syntaxnpm run format:checknpm run build