Repository navigation
Conversation
🦋 Changeset detectedLatest commit: c4fe642 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirement or Bug
Resolve #4545.
当
.kimi-code/local.toml中的workspace.additional_dir在本机不存在或不是目录时,TUI 会在用户接受 workspace trust 后静默退出。修复后,启动错误会正常显示,并包含导致失败的具体路径;print 模式和 ACP 等复用同一配置服务的入口也会得到更明确的错误信息。Bug Reproduction Steps
See linked issue.
核心场景是:在 Git 项目中配置一个不存在的
workspace.additional_dir,启动kimi并接受 workspace trust。修改前进程没有可见错误文本并直接退出;kimi -p能显示错误,但错误中没有无效路径。Root Cause
无效目录使
WorkspaceDirsService.ready拒绝后,后台初始化的三层 Promise 都可能在缺少及时消费者时产生unhandledRejection:WorkspaceDirsService的本地配置 watcher;WorkspaceRootSkillSource.watchReady;WorkspaceSkillCatalogService.ready。TUI 的全局
unhandledRejection处理器会首先退出进程,使原始错误无法继续传播到formatStartupError(),因此用户看不到任何诊断。这是根本修复:为后台 Promise 链补上拒绝观察,避免未处理 rejection,同时保持原始
readyPromise 仍为 rejected。后续显式等待这些 Promise 的调用方仍会收到同一个配置错误,不会把无效配置静默当成成功。另外,
FileProjectLocalConfigService原来对不存在、非目录和空值都返回同一条笼统消息,无法指出具体坏配置项。Code Changes
这些拒绝处理只防止后台派生 Promise 抢先触发进程级
unhandledRejection,不会把ready转成成功,也不会让无效目录继续启动。错误消息现在区分为:
阅读指南:先看
workspaceDirsService.ts和两处 skill readiness 初始化,理解错误传播;再看projectLocalConfigService.ts,理解错误文案。其余改动均为对应回归测试和 CLI changeset。Screenshots / Recordings
接受 workspace trust 后的 TUI 可见结果:
error: failed to start shell: workspace.additional_dir must exist and be a directory: D:/project/does-not-existAfter 来自本 PR 源码的真实 TUI 运行;同时会打印日志文件路径,退出码为 1。
Behavior Changes and Affected Users
additional_diradditional_dirconfig.invalid,可匹配稳定错误码或消息前缀additional_dir配置项ready仍拒绝,原有错误继续传播受影响模块与测试覆盖:
WorkspaceDirsService:新增无效本地配置回归,验证 watcher 不产生额外未处理拒绝,显式等待方仍收到原始错误。ready的回归,覆盖中间层和最外层 Promise 的未处理拒绝。FileProjectLocalConfigService:覆盖不存在、指向普通文件和空值三类输入,并验证解析后的路径。验证记录
pnpm lint:通过。pnpm typecheck:通过。changeset status:通过。pnpm test为 18,124 passed / 122 failed / 17 skipped。多数失败来自中文 checkout 路径导致 fixture URL 编码后不存在;抽查的 MCP 与 agent 超时失败在未修改的 HEAD 基线中同样复现。与本 PR 相关的测试没有失败。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.