[Bug] Workspace directory cannot be renamed on Windows — ZCode holds it locked
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
UI / 界面体验 · UI / UX
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
严重程度 · Severity
阻塞使用 · Blocking (无法使用核心功能 / core function unusable)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
Title: Workspace directory cannot be renamed on Windows — ZCode holds it locked
Environment: Windows 10 22H2 (19045), ZCode desktop installed per-user, workspace on C:, Git Bash as agent shell.
Observed:
While a workspace session is open, the workspace root directory cannot be renamed. The agent shell's CWD is reset back into the workspace after every command, so ren/mv of the workspace folder fails with "The process cannot access the file because it is being used by another process" / "Device or resource busy". This is reproducible on demand.
Additionally, I once failed to rename the workspace folder before starting ZCode, which suggests handles or background processes may outlive an apparently closed app (window closed but helpers still running). I could not confirm which process held the lock at that moment; by the time I inspected, no ZCode processes were lingering.
Expected: renaming a workspace folder should only be blocked while ZCode is genuinely running with that workspace open, and ideally ZCode would avoid pinning the shell CWD to the workspace root so the folder stays renamable.
Request: please check (a) whether the shell/session infrastructure can avoid holding the workspace root as a process CWD, and (b) whether any background processes or directory handles survive app/window close on Windows.
复现步骤 · Steps to reproduce
Environment: Windows 10 22H2 (19045), ZCode desktop installed per-user, workspace on C:, Git Bash as agent shell.
Try to rename a directory that is registered among ZCode projects and has .zcode sub-directory inside even without starting ZCode. The operation fails with a message that directory cannot be found.
期望表现 · Expected behavior
Directory renamed
实际表现 · Actual behavior
The operation fails with a message that directory cannot be found.
ZCode 版本 · ZCode version
3.10.1
设备 / 系统 / 浏览器 · Device / OS / Browser
Windows 10 22H2 (19045)
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the workspace rename failure on Windows 10 with Git Bash, then investigate the shell/session infrastructure and whether background processes or directory handles remain after the app window closes. Done means a registered workspace can be renamed when ZCode is closed, and an open session only blocks renaming while it genuinely uses the workspace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash
- Domain
- desktop, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100