Skip to content

fix: treat stray files in the session directory as missing storage en… - #3546

Open
jekhy wants to merge 2 commits into
MoonshotAI:mainfrom
jekhy:fix/session-index-enotdir
Open

fix: treat stray files in the session directory as missing storage en…#3546
jekhy wants to merge 2 commits into
MoonshotAI:mainfrom
jekhy:fix/session-index-enotdir

Conversation

@jekhy

@jekhy jekhy commented Sep 4, 2026

Copy link
Copy Markdown

…tries

A non-directory entry (e.g. a Finder .DS_Store) under sessions// made the session index stat /state.json, which fails with ENOTDIR. That errno fell through to storage.io_failed ("unrecognized I/O error"), crashed projection/reconciliation, and killed kimi -c at startup.

Map ENOTDIR to storage.not_found and treat it like ENOENT in FileStorageService read/mtime/size/delete paths so scans skip junk entries.

Related Issue

Resolve #3545

Problem

What changed

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: the issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

…tries

A non-directory entry (e.g. a Finder .DS_Store) under sessions/<workspace>/
made the session index stat <entry>/state.json, which fails with ENOTDIR.
That errno fell through to storage.io_failed ("unrecognized I/O error"),
crashed projection/reconciliation, and killed `kimi -c` at startup.

Map ENOTDIR to storage.not_found and treat it like ENOENT in
FileStorageService read/mtime/size/delete paths so scans skip junk entries.
@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: da85dae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

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.

kimi -c 命令报错: error: failed to start shell: storage stat failed: unrecognized I/O error

1 participant