[Bug] 3.11.2 设置中"用户层面"添加自定义子智能体:实际挂到当前项目且无法编辑,用户级持久化失败
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
环境
ZCode 桌面客户端 3.11.2(dev.zcode.app),macOS 26.6 Apple Silicon。当前工作区为主目录 /Users/lizhengyi。
复现步骤
- 设置 → 子智能体 → 添加,作用域明确选择 用户层面。
- 填写名称/提示词保存。
现象
- 子智能体出现在列表中,但归属显示为项目 lizhengyi(即当前工作区),不是用户级;其他工作区不可见。
- 点开该子智能体后无法调整(编辑/改作用域均无效)。
- 文件系统侧证据(逐一排查):
~/.zcode/agents/目录被创建但为空(无任何 Markdown 落盘);~/.zcode/v2/agents-state.json、setting.json、config.json均无子智能体记录;cli/db/db.sqlite与v2/tasks-index.sqlite无相关表/记录。
即用户级持久化完全失败。
推测
当前工作区为主目录时,工作区级配置目录 <workspace>/.zcode/ 与用户级 ~/.zcode/ 物理上是同一个目录,客户端的作用域归属判断可能因此错乱(写入工作区作用域 → 显示挂到项目;编辑时按用户级查找 → 找不到 → 不可编辑)。
期望
用户层面添加的子智能体应全局生效(所有工作区可见)、落盘为用户级配置(如 ~/.zcode/agents/*.md)、且可正常编辑。
附加问题
文档提到自定义子智能体以 Markdown 文件配置(model 字段决定模型)。手动放置 ~/.zcode/agents/<name>.md 能否被识别?如可,请补充该目录的文件格式说明,便于绕过 GUI 问题。
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 tracing user- and workspace-scope handling for subagents from the settings flow, using the reported paths ~/.zcode/agents/, ~/.zcode/v2/agents-state.json, setting.json, config.json, and the SQLite files as persistence checkpoints. Reproduce with the workspace set to /Users/lizhengyi; done means a user-scoped agent is stored under ~/.zcode/agents/, appears in every workspace, and can be edited.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100