fix(os): normalize Windows drive-root paths for fs.watch - #2967
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d2aeef7be
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Windows drive roots must be `D:\` (not `D:` or POSIX-ish `/D:`), otherwise | ||
| // `fs.watch` throws ENOENT: watch '/D:' when the process CWD is a drive root. |
There was a problem hiding this comment.
Move the implementation comment to the file header
Move this explanation into the top-of-file module header or make the helper self-explanatory without it. The package explicitly prohibits comments beside functions or statements, and these newly added lines narrate the normalization implementation inside the module body.
AGENTS.md reference: packages/agent-core-v2/AGENTS.md:L36-L38
Useful? React with 👍 / 👎.
|
Addressed Codex P1: moved the Windows drive-root explanation into the file header and removed the inline comments per Re: changeset — this is a bugfix; no package version bump intended, so no changeset added. |
Summary
D:can produce a POSIX-ish watch path/D:.fs.watch('/D:')then fails withENOENT: no such file or directory, watch '/D:'.D:\before creating native/chokidar watchers./D:andE:.Related: MoonshotAI/kimi-cli#2600
Testing plan
watchNativereceivesD:\\when given/D:/E:onwin32.D:\(drive root), launch Kimi Code, confirm nowatch '/D:'crash.