Bug: Include the invalid path when workspace additional-directory validation fails
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- cli
调研方向
首先找到抛出错误字符串 workspace.additional_dir must exist and be a directory 的位置,因为它同时被项目本地配置加载和 ACP 中针对 additionalDirectories 的 session/new 处理所共用。检查两条路径是否都把出错的值传入该检查。完成的标准是:错误信息包含解析后的路径,空条目会提示其为空,并且两个入口都有测试覆盖。该 issue 说明,在打开 PR 之前需要维护者批准。
由索引模型根据 Issue 内容生成。
描述
What version of Kimi Code is running?
2.1.1
Which open platform/subscription were you using?
N/A. This occurs during local workspace configuration or ACP session setup, before any provider request.
Which model were you using?
N/A. The error occurs before a model request.
What platform is your computer?
Linux 7.2.9-200.nobara.fc44.x86_64 x86_64 unknown
What issue are you seeing?
Kimi reports this error when an additional workspace directory is unavailable:
workspace.additional_dir must exist and be a directory
The message does not include the invalid path.
This affects both project-local configuration and ACP:
- A project can contain one or more invalid entries in
.kimi-code/local.toml. - An ACP client can send
session/new.params.additionalDirectories. Kimi advertises support for this capability, but an IDE does not necessarily show users which paths it sent. Diagnosing a missing path currently requires capturing ACP traffic.
In either case, users cannot identify the offending directory from the Kimi error.
What steps can reproduce the bug?
Project-local configuration
From a Git repository, create .kimi-code/local.toml:
[workspace]
additional_dir = ["/tmp/kimi-directory-that-does-not-exist"]
Start Kimi from that repository.
ACP session setup
-
Start Kimi in ACP mode:
kimi acp -
Send
initialize. Kimi advertises support for additional directories. -
Send
session/newwith a validcwdand an unavailable additional directory:{ "jsonrpc": "2.0", "id": 2, "method": "session/new", "params": { "cwd": "/path/to/project", "mcpServers": [], "additionalDirectories": [ "/path/that-is-not-available-to-kimi" ] } } -
Kimi returns the generic error without identifying the path.
What is the expected behavior?
The error should include the resolved invalid path, for example:
workspace.additional_dir must exist and be a directory: /path/that-is-not-available-to-kimi
An empty additional-directory value should report that the value is empty.
Additional information
I encountered this through JetBrains AI Assistant using Kimi via aicage, which runs the agent in a container.
JetBrains sent an additional directory that was valid on the host but unavailable inside the container.
The same missing-path diagnostic also affects non-containerized project-local configuration.
Contribution
- I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first)
- 主要语言
- TypeScript
- 星标
- 8.1k
- 派生
- 1.3k
- 平均合并
- 17 小时 41 分钟
- 30 天内合并 PR
- 172
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MoonshotAI/kimi-code 的其他 Issue
-
VS Code: Add quick chat actions to the editor title area可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 72/100
MoonshotAI/kimi-code#4591 · 1 条评论 ·
维护者通常 1 天内回复
-
VS Code: Use the Kimi icon for chat editor tabs可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 78/100
MoonshotAI/kimi-code#4590 ·
维护者通常 1 天内回复
-
[Bug] Session Markdown export corrupts YAML frontmatter for workspace paths containing # or colon-space可能已有人在做 @ADanMan 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
MoonshotAI/kimi-code#4588 · 2 条评论 ·
维护者通常 1 天内回复
-
ACP plan revision discards client feedback text可能已有人在做 @markankamaransheogarat-sys 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
MoonshotAI/kimi-code#4548 ·
维护者通常 1 天内回复
-
VS Code extension: clickable file links in chat drop the :line suffix, never jump to the line可能已有人在做 @2SinceJuly 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
MoonshotAI/kimi-code#4398 ·
维护者通常 1 天内回复
查看 MoonshotAI/kimi-code 的全部 Issue
相似的 Issue
-
mobile-app
难度 2/5 1-3 小时 新手友好度 74/100
Open-Locker/Open-Locker#352 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
leanprover-community/lean4game#589 ·
维护者通常 2 天内回复
-
check:passed streams:add
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复