feat: add remove-dir workspace management - #2784
Conversation
🦋 Changeset detectedLatest commit: bdbd38f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bdbd38f6ee
ℹ️ 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".
| 'The primary workspace directory cannot be removed', | ||
| ); | ||
| } | ||
| if (!this.additionalDirs.includes(target)) { |
There was a problem hiding this comment.
Compare remove-dir roots with canonical path keys
When the v2 engine runs on Windows and the user removes a directory with a different drive-letter/case or slash spelling than the stored entry (for example the root is stored as C:/Repo/Extra but /remove-dir c:/repo/extra is used), this exact includes check rejects the valid additional root before the forget path can update local.toml. The workspace code already has to treat those spellings as the same physical directory, so the remove path should use the same canonical comparison for additionalDirs, fileDirs, and the config-file filter; otherwise users can only remove a root if they reproduce the exact stored spelling.
Useful? React with 👍 / 👎.
Related Issue
Follow-up to #396 and #812.
Problem
/add-dircan add session-only or remembered workspace roots, but there is no symmetric way to remove one. Users must edit.kimi-code/local.tomlor restart the process, while live file-tool permissions and file-mention completion continue to include the old root.What Changed
/remove-dir [<path>]to the TUI/remove-dir [--forget] <path>to the VS Code host commandsSession.removeAdditionalDir()SDK operation and v1/v2 RPC plumbing.kimi-code/local.tomlfor remembered roots while preserving unrelated TOML fieldsVerification
git diff --checkChecklist