fix(cli): tolerate pre-existing plan directory on OneDrive#9765
Open
truffle-dev wants to merge 1 commit intoKilo-Org:mainfrom
Open
fix(cli): tolerate pre-existing plan directory on OneDrive#9765truffle-dev wants to merge 1 commit intoKilo-Org:mainfrom
truffle-dev wants to merge 1 commit intoKilo-Org:mainfrom
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gpt-5.5-2026-04-23 · 102,242 tokens |
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.
Why
Plan mode crashes with
EEXIST: file already existswhen a kilocode workspace lives on a OneDrive-synced Windows path (#9755). The.kilo/plansdirectory is a OneDrive ReparsePoint, and Node'sfs.mkdir(path, { recursive: true })still throwsEEXISTagainst ReparsePoint dirs in some Node versions even thoughrecursive: trueis supposed to be idempotent. Every plan turn fails before the plan file is written.What changed
insertPlanRemindersnow goes through a smallensurePlanDirhelper that pre-checks the directory withFilesystem.isDirand only callsmkdirwhen the dir doesn't already exist. POSIX behavior is unchanged; on the OneDrive ReparsePoint case the throwingmkdircall is skipped entirely.How to test
bun test ./test/kilocode/ensure-plan-dir.test.tsfrompackages/opencode/. The new tests cover the missing-dir, idempotent-existing-dir, and recursive-parents cases.Closes #9755