Repository navigation
Description
What version of Kimi Code is running?
2.4.0
Which open platform/subscription were you using?
N/A — the crash happens during TUI startup, before any model request.
Which model were you using?
N/A — startup fails before a session is created.
What platform is your computer?
Darwin 27.0.0 arm64 arm
What issue are you seeing?
When a project's .kimi-code/local.toml contains an additional_dir entry that does not exist on this machine, the interactive TUI exits silently right after the user accepts the workspace trust prompt. No error message, no log entry — the process just dies. This makes the affected workspace completely unopenable in TUI mode, with zero diagnostic signal.
A typical real-world trigger: the project was authored on Windows (paths like D:/project/foo) and later opened on macOS/Linux, or a co-worker's machine lacks a mounted volume.
Related but distinct from #4147: that issue covers the headless/ACP path, where the error is surfaced (albeit without the offending path). In TUI mode the error is not surfaced at all.
Headless mode on the same directory does print the error:
Error2: workspace.additional_dir must exist and be a directory
at FileProjectLocalConfigService.assertDirectory (.../main.cjs:117352:37)
at FileProjectLocalConfigService.resolveAdditionalDir (.../main.cjs:117331:4)
at FileProjectLocalConfigService.resolveAdditionalDirsInternal (.../main.cjs:117313:25)
at FileProjectLocalConfigService.readAdditionalDirs (.../main.cjs:117225:21)
TUI mode on the same directory: trust prompt appears → user presses Enter on "Trust and continue" → process exits immediately with no output.
What steps can reproduce the bug?
mkdir /tmp/kimi-repro && cd /tmp/kimi-repro
git init
mkdir .kimi-code
printf '[workspace]\nadditional_dir = ["D:/project/does-not-exist"]\n' > .kimi-code/local.toml
kimi # accept the trust prompt with EnterObserved: TUI exits immediately after trusting, silently.
Contrast: kimi -p "hi" in the same directory prints the Error2 above.
What is the expected behavior?
At minimum, the TUI should surface the error (with the offending path, cf. #4147) instead of exiting silently. Ideally an invalid additional_dir entry would degrade gracefully: show a warning, skip that entry, and let the session start — cross-machine project copies are common and one stale path should not make the whole workspace unopenable.
Additional information
Tracing the code path on main:
KimiTUI.start()→maybeRunWorkspaceTrustPrompt()callsharness.getWorkspaceTrustInfo(), which itself hitsreadAdditionalDirs— but itscatchdegrades to an untrusted-info fallback, so the trust prompt still renders.- User trusts →
initMainTui()→init()→hydrateLazyConfigDefaults()→harness.getConfig({ reload: true })/resolveSessionEnvironment→ workspace instance creation →WorkspaceDirsServiceconstructor:this.ready = this.enqueue(... reloadFromDisk() ...)→FileProjectLocalConfigService.readAdditionalDirsthrowsCONFIG_INVALID. - The rejection propagates as an unhandled promise rejection (or is swallowed by a fire-and-forget
void ...ready), so the process dies withoutformatStartupErrorever running — the catch inapps/kimi-code/src/cli/main.tsnever sees it.
Contribution
- I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first)
Activity
Grapedge commentedon Oct 30, 2026
/approve