Skip to content

fix(settings): 在使用kun的“对话”功能时,kun无法正常新建工作区#995

Closed
kelai141 wants to merge 1 commit into
KunAgent:masterfrom
kelai141:master
Closed

fix(settings): 在使用kun的“对话”功能时,kun无法正常新建工作区#995
kelai141 wants to merge 1 commit into
KunAgent:masterfrom
kelai141:master

Conversation

@kelai141

Copy link
Copy Markdown

Summary / 概要

  • 修复在https://github.com/KunAgent/Kun/issues/993中用户设置自定义 conversationWorkspaceRoot 后无法创建新会话的问题
    Why / 背景
  • Bug [Bug] 在使用kun的“对话”功能时,kun无法正常新建工作区 #993:点击 "+" 创建新会话时,若自定义路径不存在则抛出 ENOENT: mkdir 'D:\kun\work...'
  • ensureManagedWorkspaceRootsExist() 只创建默认路径 ~/Documents/Kun/conversations,从未创建用户自定义的工作区根目录
  • IPC 的 mkdir 处理器有意使用非递归模式,依赖 managed roots 预先存在
    Changes / 变更
  • src/main/settings-store.ts:208-211 — 在 ensureManagedWorkspaceRootsExist 中,当自定义 conversationWorkspaceRoot 与默认路径不同时,使用 mkdir + { recursive: true } 一并创建
    Media / 截图或录屏
  • 无,内部修复,无界面变更
    Tests / 测试
  • 通过自行封装发行版后,模拟用户操作,将路径设置于d盘,重新创建对话后正常工作
    Validation / 验证
  • I agree that this contribution is submitted under the Contributor License Agreement (https://github.com/KunAgent/Kun/blob/develop/CLA.md). / 我同意本贡献遵循 Contributor License Agreement (https://github.com/KunAgent/Kun/blob/develop/CLA.md) 提交。
  • npm run test
  • npm run typecheck
  • npm run build
  • npm run dev (if runtime or UI behavior changed / 如果运行时或界面行为有变化)
  • UI change: video or GIF attached / 界面变更:已附上视频或 GIF
  • Logic change: unit tests added or updated / 逻辑变更:已新增或更新单元测试
    Notes / 备注
  • 仅影响在设置中配置了非默认 conversationWorkspaceRoot 的用户。使用默认路径的用户不受影响。
  • IPC 中 register-app-ipc-handlers.ts:1174 的 mkdir(workspacePath) 有意省略了 { recursive: true },它依赖 ensureManagedWorkspaceRootsExist 预先创建好目录。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants