You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support '/' character in Git branch names used as workspace names
Allow forward slashes in workspace names (e.g. 'feature/my-branch') to
match common Git branch naming conventions.
Changes:
- Update validation regex to accept '/' (reject leading, trailing, and
consecutive slashes)
- Add sanitizeWorkspaceNameForPath() that replaces '/' with '-' for
filesystem paths
- Apply sanitization in getWorkspacePath() for WorktreeManager and
SSHRuntime, with an absolute-path guard for in-place workspaces
- Add path collision detection in create(), rename(), and fork() scoped
to path-based runtimes (worktree, SSH, devcontainer) using
usesPathBasedDirs() helper
- Auto-fork collision retry loop scales with existing workspace count
and uses normalized parent for legacy name compatibility
- Handle slashes in CoderSSHRuntime.toCoderCompatibleName()
- Ensure movePlanFile() creates destination directories via mkdir -p
- Same-path rename short-circuit runs best-effort git branch -m
- Update mobile validation, UI hints, and add comprehensive tests
Closes#407
error: "Workspace name can only contain lowercase letters, digits, underscore, and hyphen",
21
+
error:
22
+
"Workspace names can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes (no leading, trailing, or consecutive slashes)",
21
23
};
22
24
}
23
25
24
26
return{valid: true};
25
27
}
28
+
29
+
/**
30
+
* Convert a workspace name to a filesystem-safe path component by replacing
// Workspace names become folder names, git branches, and session directories,
21
-
// so they need to be filesystem-safe across platforms.
22
21
error:
23
-
"Workspace names can only contain lowercase letters, numbers, hyphens, and underscores",
22
+
"Workspace names can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes (no leading, trailing, or consecutive slashes)",
24
23
};
25
24
}
26
25
27
26
return{valid: true};
28
27
}
28
+
29
+
/**
30
+
* Convert a workspace name to a filesystem-safe path component by replacing
31
+
* forward slashes with hyphens.
32
+
*
33
+
* This allows git-style branch names like "feature/my-branch" to be used as
34
+
* workspace names while remaining safe for directory names and session paths.
0 commit comments