Repository navigation
feat(server): place the default workspace under the home folder - #4277
Conversation
The default workspace lived in <Documents>/KimiCode/Default. On macOS the first chat there triggered a Documents privacy prompt, and a denial blocked every later chat until the user found the setting. Documents is also synced by iCloud and OneDrive, and covered by Windows Controlled Folder Access. Use ~/KimiCode/Default on every platform instead. This drops the Windows PowerShell lookup, the XDG user-dirs parsing, and the documents_unavailable reason; the error path is now always present.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
…shotAI#4277) Ported from MoonshotAI/kimi-code 2.3.0 (e5e56bc). The default workspace no longer resolves a per-platform Documents folder: it is `<home>/KimiCode/Default` unless `default_workspace.path` says otherwise, which drops the XDG / PowerShell documents probes and the code that parsed their output. Conflicts resolved: - defaultWorkspace.test.ts: the two XDG documents cases and the PowerShell probe cases are gone upstream, so the conflict block was resolved to upstream and the surviving "expands a leading tilde against the user home" case kept this file's `it.skipIf(process.platform === 'win32')` guard — `$HOME` is a Windows path here, so the POSIX-shaped assertion cannot hold locally. Verification: - bun run typecheck: every package and app exits 0 - packages/agent-core-v2: 7883 pass / 1 fail / 0 errors. The failure is the fullCompaction pre-shrink case that fails on the parent commit. A second file, test/mcpCore/oauth/service-lifecycle.test.ts, kills the Bun process (exit 3, native crash, no assertion); it crashes identically on the parent commit, so it is environmental, not this port. - packages/kap-server: 1371 pass / 0 fail / 0 errors - defaultWorkspace suite: 8 pass, 3 skip, 0 fail - check:no-comments, no-hardcoded-prose, t-coverage, locale-keys all OK
Requirement or Bug
默认工作区从
<文稿>/KimiCode/Default改到~/KimiCode/Default,避开 macOS 文稿授权弹窗和文稿云同步。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
默认工作区(#4224,尚未发版)原来放在系统文稿目录里,有三个问题:
主目录下的普通文件夹不受这三者影响,在 Finder / 资源管理器里也找得到。
随之删除:
defaultWorkspacePaths.ts里的 XDG 解析、PowerShell 命令与输出解析、defaultDocumentsDir。IHostProcessService的依赖、文稿路径缓存与失败重试。documents_unavailable(core 类型、server 的40930data schema、文档)。40930的data.path改为必有字符串:去掉documents_unavailable后,所有原因都带路径。文档:
server-api.md和config-files.md(中英)里的默认位置与原因列表同步更新。Behavior Changes and Affected Users
default_workspace.path时的默认工作区位置<文稿>/KimiCode/Default(Windows 按系统登记的文稿位置,Linux 按 XDG)~/KimiCode/Defaultdefault_workspace.path可指回原位置40930的reason取值documents_unavailable40930的data.pathstring | nullstring受影响模块与测试:
agent-core-v2/app/defaultWorkspace:defaultWorkspace.test.ts改为断言主目录位置,保留首次创建与复用、删除后重建、尾部分隔符判断、被文件占用、无权限、自定义位置等用例;删去 XDG 与 Windows 文稿查找的用例。kap-server:sessions.test.ts的40930用例不变并通过;全量 1453 个测试通过。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.(默认工作区尚未发版,feat: add a default workspace for chats without a project #4224 也未写 changeset)gen-docsskill, or this PR needs no doc update.