deps(knip): enable production mode and remove dead code#527
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR removes unused exports, deprecated helpers, components, and dependencies across the CLI, core packages, services, and webview. It expands Knip workspace configuration, narrows selected types, updates CLI packaging, and adds settings and path utility tests. ChangesRepository cleanup
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Caller
participant getCommandDecision
participant parseCommand
participant getSingleCommandDecision
Caller->>getCommandDecision: command and allow/deny lists
getCommandDecision->>parseCommand: parse command chain
parseCommand-->>getCommandDecision: parsed sub-commands
getCommandDecision->>getSingleCommandDecision: evaluate each sub-command
getSingleCommandDecision-->>getCommandDecision: approval decision
getCommandDecision-->>Caller: aggregate decision
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
25afd0b to
881ebf9
Compare
9d75f36 to
864d937
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/vscode-shim/src/types.ts (1)
73-88: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winRestore the types still re-exported by the public entry point.
packages/vscode-shim/src/index.tsLines 74-82 still re-exportsTextDocument,TextLine,WorkspaceFolder,WorkspaceConfiguration, andCancellationToken. Removing their declarations from this module makes those re-exports fail TypeScript compilation. Restore these interfaces here, or remove/update the corresponding public re-exports as an intentional breaking API change.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/vscode-shim/src/types.ts` around lines 73 - 88, The public entry point still re-exports types missing from this module. In packages/vscode-shim/src/types.ts, restore the TextDocument, TextLine, WorkspaceFolder, WorkspaceConfiguration, and CancellationToken interfaces expected by src/index.ts, preserving their existing public contracts; alternatively, intentionally update the corresponding re-exports in src/index.ts as a breaking API change.
🧹 Nitpick comments (1)
webview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.ts (1)
33-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover providers restricted to specific models.
This only exercises
allowAll: true; add a provider withallowAll: falseand a non-emptymodelslist to cover the other inclusion branch infilterProviders.Proposed coverage
+ it("keeps providers with explicitly allowlisted models", () => { + const allowList: OrganizationAllowList = { + allowAll: false, + providers: { + openai: { allowAll: false, models: ["model1"] }, + }, + } + + expect(filterProviders(mockProviders, allowList)).toEqual([{ value: "openai", label: "OpenAI" }]) + })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.ts` around lines 33 - 45, Add a provider entry with allowAll set to false and a non-empty models list to the allowList in the “filters providers based on allowlist” test, then update the expected length and assertions to verify that filterProviders includes this provider alongside the existing allowAll providers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@webview-ui/src/utils/__tests__/path-mentions.spec.ts`:
- Around line 82-86: Update the convertToMentionPath test case for an external
path sharing the CWD prefix to expect the original absolute path, not a
workspace mention. In convertToMentionPath, only strip cwd when the path equals
cwd or starts with cwd followed by a directory separator, preserving the
existing leading-slash behavior for paths inside the workspace.
---
Outside diff comments:
In `@packages/vscode-shim/src/types.ts`:
- Around line 73-88: The public entry point still re-exports types missing from
this module. In packages/vscode-shim/src/types.ts, restore the TextDocument,
TextLine, WorkspaceFolder, WorkspaceConfiguration, and CancellationToken
interfaces expected by src/index.ts, preserving their existing public contracts;
alternatively, intentionally update the corresponding re-exports in src/index.ts
as a breaking API change.
---
Nitpick comments:
In
`@webview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.ts`:
- Around line 33-45: Add a provider entry with allowAll set to false and a
non-empty models list to the allowList in the “filters providers based on
allowlist” test, then update the expected length and assertions to verify that
filterProviders includes this provider alongside the existing allowAll
providers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 944f464f-9445-41c6-883f-74712fb2e59b
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (105)
.github/workflows/cli-release.ymlapps/cli/package.jsonapps/cli/scripts/build.shapps/cli/src/agent/__tests__/extension-host.test.tsapps/cli/src/agent/agent-state.tsapps/cli/src/agent/extension-client.tsapps/cli/src/agent/extension-host.tsapps/cli/src/agent/message-processor.tsapps/cli/src/agent/state-store.tsapps/cli/src/commands/cli/list.tsapps/cli/src/commands/cli/run.tsapps/cli/src/lib/sdk/client.tsapps/cli/src/lib/sdk/index.tsapps/cli/src/lib/sdk/types.tsapps/cli/src/lib/storage/credentials.tsapps/cli/src/lib/storage/settings.tsapps/cli/src/lib/task-history/index.tsapps/cli/src/ui/App.tsxapps/cli/src/ui/components/Header.tsxapps/cli/src/ui/components/Icon.tsxapps/cli/src/ui/components/TodoChangeDisplay.tsxapps/cli/src/ui/components/__tests__/TodoChangeDisplay.test.tsxapps/cli/src/ui/components/tools/utils.tsapps/cli/src/ui/hooks/useExtensionHost.tsapps/cli/src/ui/theme.tsknip.jsonpackages/build/src/types.tspackages/types/src/task.tspackages/vscode-shim/src/types.tspackages/vscode-shim/src/utils/paths.tssrc/api/providers/fetchers/__tests__/versionedSettings.spec.tssrc/api/providers/fetchers/modelEndpointCache.tssrc/api/providers/fetchers/openrouter.tssrc/api/providers/fetchers/versionedSettings.tssrc/api/providers/index.tssrc/api/providers/lm-studio.tssrc/api/providers/openai-compatible.tssrc/api/providers/utils/image-generation.tssrc/api/transform/cache-strategy/types.tssrc/api/transform/minimax-format.tssrc/api/transform/reasoning.tssrc/api/transform/vscode-lm-format.tssrc/core/auto-approval/commands.tssrc/core/config/importExport.tssrc/core/message-queue/MessageQueueService.tssrc/core/prompts/tools/filter-tools-for-mode.tssrc/core/prompts/tools/native-tools/index.tssrc/core/prompts/tools/native-tools/read_file.tssrc/core/task/build-tools.tssrc/core/tools/EditTool.tssrc/core/tools/SearchAndReplaceTool.tssrc/core/tools/UpdateTodoListTool.tssrc/core/tools/__tests__/searchAndReplaceTool.spec.tssrc/core/webview/ClineProvider.tssrc/core/webview/checkpointRestoreHandler.tssrc/eslint-suppressions.jsonsrc/i18n/index.tssrc/integrations/misc/__tests__/line-counter.spec.tssrc/integrations/misc/__tests__/read-lines.spec.tssrc/integrations/misc/extract-text.tssrc/integrations/misc/line-counter.tssrc/integrations/misc/read-lines.tssrc/package.jsonsrc/services/code-index/interfaces/manager.tssrc/services/code-index/semble/semble-downloader.tssrc/services/code-index/shared/validation-helpers.tssrc/services/command/built-in-commands.tssrc/services/roo-config/index.tssrc/services/tree-sitter/index.tssrc/services/tree-sitter/markdownParser.tssrc/services/tree-sitter/queries/scala.tssrc/shared/context-mentions.tssrc/shared/modes.tssrc/shared/parse-command.tssrc/shared/tools.tssrc/utils/TaskSemaphore.tssrc/utils/WorkspacePathResolver.tssrc/utils/config.tssrc/utils/networkProxy.tswebview-ui/package.jsonwebview-ui/src/components/chat/BatchListFilesPermission.tsxwebview-ui/src/components/chat/CheckpointRestoreDialog.tsxwebview-ui/src/components/chat/ErrorRow.tsxwebview-ui/src/components/chat/ProfileViolationWarning.tsxwebview-ui/src/components/chat/SlashCommandItemSimple.tsxwebview-ui/src/components/chat/TooManyToolsWarning.tsxwebview-ui/src/components/chat/WarningRow.tsxwebview-ui/src/components/chat/__tests__/BatchListFilesPermission.spec.tsxwebview-ui/src/components/chat/__tests__/ChatView.scroll-debug-repro.spec.tsxwebview-ui/src/components/chat/__tests__/ErrorRow.spec.tsxwebview-ui/src/components/chat/__tests__/SlashCommandItemSimple.spec.tsxwebview-ui/src/components/chat/__tests__/TooManyToolsWarning.spec.tsxwebview-ui/src/components/chat/__tests__/WarningRow.spec.tsxwebview-ui/src/components/common/DismissibleUpsell.tsxwebview-ui/src/components/common/__tests__/DismissibleUpsell.spec.tsxwebview-ui/src/components/settings/useSettingsSearch.tswebview-ui/src/components/settings/utils/__tests__/headers.spec.tswebview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.tswebview-ui/src/components/ui/select-dropdown.tsxwebview-ui/src/hooks/useTooManyTools.tswebview-ui/src/i18n/TranslationContext.tsxwebview-ui/src/oauth/urls.tswebview-ui/src/utils/__tests__/path-mentions.spec.tswebview-ui/src/utils/format.tswebview-ui/src/utils/sourceMapUtils.ts
💤 Files with no reviewable changes (57)
- src/core/tools/tests/searchAndReplaceTool.spec.ts
- webview-ui/src/components/chat/tests/BatchListFilesPermission.spec.tsx
- src/integrations/misc/line-counter.ts
- src/integrations/misc/tests/line-counter.spec.ts
- src/api/transform/minimax-format.ts
- apps/cli/src/lib/sdk/types.ts
- webview-ui/src/oauth/urls.ts
- apps/cli/src/lib/sdk/index.ts
- webview-ui/src/components/chat/BatchListFilesPermission.tsx
- apps/cli/src/agent/state-store.ts
- webview-ui/src/components/chat/TooManyToolsWarning.tsx
- webview-ui/src/components/chat/tests/TooManyToolsWarning.spec.tsx
- src/api/providers/fetchers/tests/versionedSettings.spec.ts
- apps/cli/src/ui/components/tests/TodoChangeDisplay.test.tsx
- src/integrations/misc/read-lines.ts
- src/integrations/misc/tests/read-lines.spec.ts
- src/core/tools/SearchAndReplaceTool.ts
- packages/types/src/task.ts
- webview-ui/src/components/common/tests/DismissibleUpsell.spec.tsx
- apps/cli/src/ui/components/TodoChangeDisplay.tsx
- webview-ui/src/components/chat/tests/SlashCommandItemSimple.spec.tsx
- apps/cli/src/lib/sdk/client.ts
- webview-ui/src/components/chat/SlashCommandItemSimple.tsx
- webview-ui/src/components/chat/tests/ChatView.scroll-debug-repro.spec.tsx
- src/core/tools/EditTool.ts
- webview-ui/src/components/settings/useSettingsSearch.ts
- webview-ui/src/components/ui/select-dropdown.tsx
- apps/cli/src/agent/extension-host.ts
- apps/cli/src/agent/tests/extension-host.test.ts
- src/core/task/build-tools.ts
- src/core/prompts/tools/native-tools/index.ts
- src/api/providers/fetchers/modelEndpointCache.ts
- apps/cli/src/ui/components/Header.tsx
- src/api/providers/fetchers/versionedSettings.ts
- src/core/webview/checkpointRestoreHandler.ts
- src/shared/modes.ts
- .github/workflows/cli-release.yml
- apps/cli/src/ui/components/tools/utils.ts
- src/core/prompts/tools/native-tools/read_file.ts
- webview-ui/src/components/chat/CheckpointRestoreDialog.tsx
- apps/cli/src/commands/cli/list.ts
- apps/cli/src/commands/cli/run.ts
- apps/cli/src/ui/App.tsx
- apps/cli/scripts/build.sh
- src/core/tools/UpdateTodoListTool.ts
- apps/cli/src/agent/agent-state.ts
- src/i18n/index.ts
- src/api/providers/index.ts
- src/eslint-suppressions.json
- apps/cli/src/ui/theme.ts
- packages/build/src/types.ts
- src/package.json
- src/shared/context-mentions.ts
- apps/cli/src/ui/hooks/useExtensionHost.ts
- apps/cli/src/agent/message-processor.ts
- webview-ui/src/components/common/DismissibleUpsell.tsx
- src/core/auto-approval/commands.ts
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/vscode-shim/src/types.ts (1)
73-88: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick winRestore the types still re-exported by the public entry point.
packages/vscode-shim/src/index.tsLines 74-82 still re-exportsTextDocument,TextLine,WorkspaceFolder,WorkspaceConfiguration, andCancellationToken. Removing their declarations from this module makes those re-exports fail TypeScript compilation. Restore these interfaces here, or remove/update the corresponding public re-exports as an intentional breaking API change.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/vscode-shim/src/types.ts` around lines 73 - 88, The public entry point still re-exports types missing from this module. In packages/vscode-shim/src/types.ts, restore the TextDocument, TextLine, WorkspaceFolder, WorkspaceConfiguration, and CancellationToken interfaces expected by src/index.ts, preserving their existing public contracts; alternatively, intentionally update the corresponding re-exports in src/index.ts as a breaking API change.
🧹 Nitpick comments (1)
webview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.ts (1)
33-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover providers restricted to specific models.
This only exercises
allowAll: true; add a provider withallowAll: falseand a non-emptymodelslist to cover the other inclusion branch infilterProviders.Proposed coverage
+ it("keeps providers with explicitly allowlisted models", () => { + const allowList: OrganizationAllowList = { + allowAll: false, + providers: { + openai: { allowAll: false, models: ["model1"] }, + }, + } + + expect(filterProviders(mockProviders, allowList)).toEqual([{ value: "openai", label: "OpenAI" }]) + })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.ts` around lines 33 - 45, Add a provider entry with allowAll set to false and a non-empty models list to the allowList in the “filters providers based on allowlist” test, then update the expected length and assertions to verify that filterProviders includes this provider alongside the existing allowAll providers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@webview-ui/src/utils/__tests__/path-mentions.spec.ts`:
- Around line 82-86: Update the convertToMentionPath test case for an external
path sharing the CWD prefix to expect the original absolute path, not a
workspace mention. In convertToMentionPath, only strip cwd when the path equals
cwd or starts with cwd followed by a directory separator, preserving the
existing leading-slash behavior for paths inside the workspace.
---
Outside diff comments:
In `@packages/vscode-shim/src/types.ts`:
- Around line 73-88: The public entry point still re-exports types missing from
this module. In packages/vscode-shim/src/types.ts, restore the TextDocument,
TextLine, WorkspaceFolder, WorkspaceConfiguration, and CancellationToken
interfaces expected by src/index.ts, preserving their existing public contracts;
alternatively, intentionally update the corresponding re-exports in src/index.ts
as a breaking API change.
---
Nitpick comments:
In
`@webview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.ts`:
- Around line 33-45: Add a provider entry with allowAll set to false and a
non-empty models list to the allowList in the “filters providers based on
allowlist” test, then update the expected length and assertions to verify that
filterProviders includes this provider alongside the existing allowAll
providers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 944f464f-9445-41c6-883f-74712fb2e59b
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (105)
.github/workflows/cli-release.ymlapps/cli/package.jsonapps/cli/scripts/build.shapps/cli/src/agent/__tests__/extension-host.test.tsapps/cli/src/agent/agent-state.tsapps/cli/src/agent/extension-client.tsapps/cli/src/agent/extension-host.tsapps/cli/src/agent/message-processor.tsapps/cli/src/agent/state-store.tsapps/cli/src/commands/cli/list.tsapps/cli/src/commands/cli/run.tsapps/cli/src/lib/sdk/client.tsapps/cli/src/lib/sdk/index.tsapps/cli/src/lib/sdk/types.tsapps/cli/src/lib/storage/credentials.tsapps/cli/src/lib/storage/settings.tsapps/cli/src/lib/task-history/index.tsapps/cli/src/ui/App.tsxapps/cli/src/ui/components/Header.tsxapps/cli/src/ui/components/Icon.tsxapps/cli/src/ui/components/TodoChangeDisplay.tsxapps/cli/src/ui/components/__tests__/TodoChangeDisplay.test.tsxapps/cli/src/ui/components/tools/utils.tsapps/cli/src/ui/hooks/useExtensionHost.tsapps/cli/src/ui/theme.tsknip.jsonpackages/build/src/types.tspackages/types/src/task.tspackages/vscode-shim/src/types.tspackages/vscode-shim/src/utils/paths.tssrc/api/providers/fetchers/__tests__/versionedSettings.spec.tssrc/api/providers/fetchers/modelEndpointCache.tssrc/api/providers/fetchers/openrouter.tssrc/api/providers/fetchers/versionedSettings.tssrc/api/providers/index.tssrc/api/providers/lm-studio.tssrc/api/providers/openai-compatible.tssrc/api/providers/utils/image-generation.tssrc/api/transform/cache-strategy/types.tssrc/api/transform/minimax-format.tssrc/api/transform/reasoning.tssrc/api/transform/vscode-lm-format.tssrc/core/auto-approval/commands.tssrc/core/config/importExport.tssrc/core/message-queue/MessageQueueService.tssrc/core/prompts/tools/filter-tools-for-mode.tssrc/core/prompts/tools/native-tools/index.tssrc/core/prompts/tools/native-tools/read_file.tssrc/core/task/build-tools.tssrc/core/tools/EditTool.tssrc/core/tools/SearchAndReplaceTool.tssrc/core/tools/UpdateTodoListTool.tssrc/core/tools/__tests__/searchAndReplaceTool.spec.tssrc/core/webview/ClineProvider.tssrc/core/webview/checkpointRestoreHandler.tssrc/eslint-suppressions.jsonsrc/i18n/index.tssrc/integrations/misc/__tests__/line-counter.spec.tssrc/integrations/misc/__tests__/read-lines.spec.tssrc/integrations/misc/extract-text.tssrc/integrations/misc/line-counter.tssrc/integrations/misc/read-lines.tssrc/package.jsonsrc/services/code-index/interfaces/manager.tssrc/services/code-index/semble/semble-downloader.tssrc/services/code-index/shared/validation-helpers.tssrc/services/command/built-in-commands.tssrc/services/roo-config/index.tssrc/services/tree-sitter/index.tssrc/services/tree-sitter/markdownParser.tssrc/services/tree-sitter/queries/scala.tssrc/shared/context-mentions.tssrc/shared/modes.tssrc/shared/parse-command.tssrc/shared/tools.tssrc/utils/TaskSemaphore.tssrc/utils/WorkspacePathResolver.tssrc/utils/config.tssrc/utils/networkProxy.tswebview-ui/package.jsonwebview-ui/src/components/chat/BatchListFilesPermission.tsxwebview-ui/src/components/chat/CheckpointRestoreDialog.tsxwebview-ui/src/components/chat/ErrorRow.tsxwebview-ui/src/components/chat/ProfileViolationWarning.tsxwebview-ui/src/components/chat/SlashCommandItemSimple.tsxwebview-ui/src/components/chat/TooManyToolsWarning.tsxwebview-ui/src/components/chat/WarningRow.tsxwebview-ui/src/components/chat/__tests__/BatchListFilesPermission.spec.tsxwebview-ui/src/components/chat/__tests__/ChatView.scroll-debug-repro.spec.tsxwebview-ui/src/components/chat/__tests__/ErrorRow.spec.tsxwebview-ui/src/components/chat/__tests__/SlashCommandItemSimple.spec.tsxwebview-ui/src/components/chat/__tests__/TooManyToolsWarning.spec.tsxwebview-ui/src/components/chat/__tests__/WarningRow.spec.tsxwebview-ui/src/components/common/DismissibleUpsell.tsxwebview-ui/src/components/common/__tests__/DismissibleUpsell.spec.tsxwebview-ui/src/components/settings/useSettingsSearch.tswebview-ui/src/components/settings/utils/__tests__/headers.spec.tswebview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.tswebview-ui/src/components/ui/select-dropdown.tsxwebview-ui/src/hooks/useTooManyTools.tswebview-ui/src/i18n/TranslationContext.tsxwebview-ui/src/oauth/urls.tswebview-ui/src/utils/__tests__/path-mentions.spec.tswebview-ui/src/utils/format.tswebview-ui/src/utils/sourceMapUtils.ts
💤 Files with no reviewable changes (57)
- src/core/tools/tests/searchAndReplaceTool.spec.ts
- webview-ui/src/components/chat/tests/BatchListFilesPermission.spec.tsx
- src/integrations/misc/line-counter.ts
- src/integrations/misc/tests/line-counter.spec.ts
- src/api/transform/minimax-format.ts
- apps/cli/src/lib/sdk/types.ts
- webview-ui/src/oauth/urls.ts
- apps/cli/src/lib/sdk/index.ts
- webview-ui/src/components/chat/BatchListFilesPermission.tsx
- apps/cli/src/agent/state-store.ts
- webview-ui/src/components/chat/TooManyToolsWarning.tsx
- webview-ui/src/components/chat/tests/TooManyToolsWarning.spec.tsx
- src/api/providers/fetchers/tests/versionedSettings.spec.ts
- apps/cli/src/ui/components/tests/TodoChangeDisplay.test.tsx
- src/integrations/misc/read-lines.ts
- src/integrations/misc/tests/read-lines.spec.ts
- src/core/tools/SearchAndReplaceTool.ts
- packages/types/src/task.ts
- webview-ui/src/components/common/tests/DismissibleUpsell.spec.tsx
- apps/cli/src/ui/components/TodoChangeDisplay.tsx
- webview-ui/src/components/chat/tests/SlashCommandItemSimple.spec.tsx
- apps/cli/src/lib/sdk/client.ts
- webview-ui/src/components/chat/SlashCommandItemSimple.tsx
- webview-ui/src/components/chat/tests/ChatView.scroll-debug-repro.spec.tsx
- src/core/tools/EditTool.ts
- webview-ui/src/components/settings/useSettingsSearch.ts
- webview-ui/src/components/ui/select-dropdown.tsx
- apps/cli/src/agent/extension-host.ts
- apps/cli/src/agent/tests/extension-host.test.ts
- src/core/task/build-tools.ts
- src/core/prompts/tools/native-tools/index.ts
- src/api/providers/fetchers/modelEndpointCache.ts
- apps/cli/src/ui/components/Header.tsx
- src/api/providers/fetchers/versionedSettings.ts
- src/core/webview/checkpointRestoreHandler.ts
- src/shared/modes.ts
- .github/workflows/cli-release.yml
- apps/cli/src/ui/components/tools/utils.ts
- src/core/prompts/tools/native-tools/read_file.ts
- webview-ui/src/components/chat/CheckpointRestoreDialog.tsx
- apps/cli/src/commands/cli/list.ts
- apps/cli/src/commands/cli/run.ts
- apps/cli/src/ui/App.tsx
- apps/cli/scripts/build.sh
- src/core/tools/UpdateTodoListTool.ts
- apps/cli/src/agent/agent-state.ts
- src/i18n/index.ts
- src/api/providers/index.ts
- src/eslint-suppressions.json
- apps/cli/src/ui/theme.ts
- packages/build/src/types.ts
- src/package.json
- src/shared/context-mentions.ts
- apps/cli/src/ui/hooks/useExtensionHost.ts
- apps/cli/src/agent/message-processor.ts
- webview-ui/src/components/common/DismissibleUpsell.tsx
- src/core/auto-approval/commands.ts
🛑 Comments failed to post (1)
webview-ui/src/utils/__tests__/path-mentions.spec.ts (1)
82-86: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Require a directory boundary after the CWD.
/Users/test/projectfile.txtis outside/Users/test/project; asserting@/file.txtturns an external path into an incorrect workspace mention. Expect the original path here and change the production predicate to require equality orcwd + "/".Proposed fix
--- webview-ui/src/utils/path-mentions.ts - if (lowerPath.startsWith(lowerCwd)) { + if (lowerPath === lowerCwd || lowerPath.startsWith(`${lowerCwd}/`)) { --- webview-ui/src/utils/__tests__/path-mentions.spec.ts - it("should add leading slash if missing after cwd removal", () => { + it("should not treat a shared string prefix as a path within cwd", () => { const absPath = "/Users/test/projectfile.txt" const cwd = "/Users/test/project" - expect(convertToMentionPath(absPath, cwd)).toBe("`@/file.txt`") + expect(convertToMentionPath(absPath, cwd)).toBe(absPath) })📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.it("should not treat a shared string prefix as a path within cwd", () => { const absPath = "/Users/test/projectfile.txt" const cwd = "/Users/test/project" expect(convertToMentionPath(absPath, cwd)).toBe(absPath) })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webview-ui/src/utils/__tests__/path-mentions.spec.ts` around lines 82 - 86, Update the convertToMentionPath test case for an external path sharing the CWD prefix to expect the original absolute path, not a workspace mention. In convertToMentionPath, only strip cwd when the path equals cwd or starts with cwd followed by a directory separator, preserving the existing leading-slash behavior for paths inside the workspace.
864d937 to
4050013
Compare
4050013 to
40bf2c3
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
webview-ui/src/utils/path-mentions.ts (1)
68-68: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a sibling-prefix regression test.
This fixes the false-positive case where
/workspace-other/...could previously match/workspace. Ensure the package-local Vitest suite asserts that such a sibling path remains unchanged.As per coding guidelines:
**/*.{test,spec}.{ts,tsx,js}must use package-local unit tests for pure logic.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webview-ui/src/utils/path-mentions.ts` at line 68, Add a package-local Vitest unit test for the path-mention logic surrounding the lowerPath/lowerCwd prefix check, covering a sibling path such as /workspace-other/... when the cwd is /workspace. Assert the sibling path remains unchanged, using the repository’s existing test naming and setup conventions.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@webview-ui/src/utils/path-mentions.ts`:
- Line 68: Add a package-local Vitest unit test for the path-mention logic
surrounding the lowerPath/lowerCwd prefix check, covering a sibling path such as
/workspace-other/... when the cwd is /workspace. Assert the sibling path remains
unchanged, using the repository’s existing test naming and setup conventions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 012dc078-9042-4858-bae9-3be34a00d867
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (106)
.github/workflows/cli-release.ymlapps/cli/package.jsonapps/cli/scripts/build.shapps/cli/src/agent/__tests__/extension-host.test.tsapps/cli/src/agent/agent-state.tsapps/cli/src/agent/extension-client.tsapps/cli/src/agent/extension-host.tsapps/cli/src/agent/message-processor.tsapps/cli/src/agent/state-store.tsapps/cli/src/commands/cli/list.tsapps/cli/src/commands/cli/run.tsapps/cli/src/lib/sdk/client.tsapps/cli/src/lib/sdk/index.tsapps/cli/src/lib/sdk/types.tsapps/cli/src/lib/storage/credentials.tsapps/cli/src/lib/storage/settings.tsapps/cli/src/lib/task-history/index.tsapps/cli/src/ui/App.tsxapps/cli/src/ui/components/Header.tsxapps/cli/src/ui/components/Icon.tsxapps/cli/src/ui/components/TodoChangeDisplay.tsxapps/cli/src/ui/components/__tests__/TodoChangeDisplay.test.tsxapps/cli/src/ui/components/tools/utils.tsapps/cli/src/ui/hooks/useExtensionHost.tsapps/cli/src/ui/theme.tsknip.jsonpackages/build/src/types.tspackages/types/src/task.tspackages/vscode-shim/src/types.tspackages/vscode-shim/src/utils/paths.tssrc/api/providers/fetchers/__tests__/versionedSettings.spec.tssrc/api/providers/fetchers/modelEndpointCache.tssrc/api/providers/fetchers/openrouter.tssrc/api/providers/fetchers/versionedSettings.tssrc/api/providers/index.tssrc/api/providers/lm-studio.tssrc/api/providers/openai-compatible.tssrc/api/providers/utils/image-generation.tssrc/api/transform/cache-strategy/types.tssrc/api/transform/minimax-format.tssrc/api/transform/reasoning.tssrc/api/transform/vscode-lm-format.tssrc/core/auto-approval/commands.tssrc/core/config/importExport.tssrc/core/message-queue/MessageQueueService.tssrc/core/prompts/tools/filter-tools-for-mode.tssrc/core/prompts/tools/native-tools/index.tssrc/core/prompts/tools/native-tools/read_file.tssrc/core/task/build-tools.tssrc/core/tools/EditTool.tssrc/core/tools/SearchAndReplaceTool.tssrc/core/tools/UpdateTodoListTool.tssrc/core/tools/__tests__/searchAndReplaceTool.spec.tssrc/core/webview/ClineProvider.tssrc/core/webview/checkpointRestoreHandler.tssrc/eslint-suppressions.jsonsrc/i18n/index.tssrc/integrations/misc/__tests__/line-counter.spec.tssrc/integrations/misc/__tests__/read-lines.spec.tssrc/integrations/misc/extract-text.tssrc/integrations/misc/line-counter.tssrc/integrations/misc/read-lines.tssrc/package.jsonsrc/services/code-index/interfaces/manager.tssrc/services/code-index/semble/semble-downloader.tssrc/services/code-index/shared/validation-helpers.tssrc/services/command/built-in-commands.tssrc/services/roo-config/index.tssrc/services/tree-sitter/index.tssrc/services/tree-sitter/markdownParser.tssrc/services/tree-sitter/queries/scala.tssrc/shared/context-mentions.tssrc/shared/modes.tssrc/shared/parse-command.tssrc/shared/tools.tssrc/utils/TaskSemaphore.tssrc/utils/WorkspacePathResolver.tssrc/utils/config.tssrc/utils/networkProxy.tswebview-ui/package.jsonwebview-ui/src/components/chat/BatchListFilesPermission.tsxwebview-ui/src/components/chat/CheckpointRestoreDialog.tsxwebview-ui/src/components/chat/ErrorRow.tsxwebview-ui/src/components/chat/ProfileViolationWarning.tsxwebview-ui/src/components/chat/SlashCommandItemSimple.tsxwebview-ui/src/components/chat/TooManyToolsWarning.tsxwebview-ui/src/components/chat/WarningRow.tsxwebview-ui/src/components/chat/__tests__/BatchListFilesPermission.spec.tsxwebview-ui/src/components/chat/__tests__/ChatView.scroll-debug-repro.spec.tsxwebview-ui/src/components/chat/__tests__/ErrorRow.spec.tsxwebview-ui/src/components/chat/__tests__/SlashCommandItemSimple.spec.tsxwebview-ui/src/components/chat/__tests__/TooManyToolsWarning.spec.tsxwebview-ui/src/components/chat/__tests__/WarningRow.spec.tsxwebview-ui/src/components/common/DismissibleUpsell.tsxwebview-ui/src/components/common/__tests__/DismissibleUpsell.spec.tsxwebview-ui/src/components/settings/useSettingsSearch.tswebview-ui/src/components/settings/utils/__tests__/headers.spec.tswebview-ui/src/components/settings/utils/__tests__/organizationFilters.spec.tswebview-ui/src/components/ui/select-dropdown.tsxwebview-ui/src/hooks/useTooManyTools.tswebview-ui/src/i18n/TranslationContext.tsxwebview-ui/src/oauth/urls.tswebview-ui/src/utils/__tests__/path-mentions.spec.tswebview-ui/src/utils/format.tswebview-ui/src/utils/path-mentions.tswebview-ui/src/utils/sourceMapUtils.ts
💤 Files with no reviewable changes (57)
- apps/cli/src/lib/sdk/types.ts
- webview-ui/src/components/ui/select-dropdown.tsx
- src/api/providers/fetchers/tests/versionedSettings.spec.ts
- src/api/providers/index.ts
- webview-ui/src/components/chat/tests/BatchListFilesPermission.spec.tsx
- src/i18n/index.ts
- apps/cli/src/ui/hooks/useExtensionHost.ts
- packages/types/src/task.ts
- src/core/prompts/tools/native-tools/read_file.ts
- src/core/tools/SearchAndReplaceTool.ts
- webview-ui/src/components/chat/TooManyToolsWarning.tsx
- webview-ui/src/components/common/DismissibleUpsell.tsx
- webview-ui/src/components/chat/BatchListFilesPermission.tsx
- webview-ui/src/components/chat/CheckpointRestoreDialog.tsx
- src/api/transform/minimax-format.ts
- webview-ui/src/components/chat/tests/SlashCommandItemSimple.spec.tsx
- src/core/tools/tests/searchAndReplaceTool.spec.ts
- apps/cli/src/lib/sdk/client.ts
- src/core/task/build-tools.ts
- apps/cli/src/ui/components/tests/TodoChangeDisplay.test.tsx
- apps/cli/src/ui/components/tools/utils.ts
- src/integrations/misc/tests/read-lines.spec.ts
- apps/cli/src/agent/state-store.ts
- src/core/tools/EditTool.ts
- src/shared/context-mentions.ts
- apps/cli/src/agent/extension-host.ts
- apps/cli/src/agent/tests/extension-host.test.ts
- apps/cli/src/agent/agent-state.ts
- src/core/prompts/tools/native-tools/index.ts
- apps/cli/src/lib/sdk/index.ts
- src/integrations/misc/tests/line-counter.spec.ts
- webview-ui/src/components/chat/tests/ChatView.scroll-debug-repro.spec.tsx
- apps/cli/src/commands/cli/run.ts
- src/core/webview/checkpointRestoreHandler.ts
- apps/cli/src/ui/components/TodoChangeDisplay.tsx
- webview-ui/src/oauth/urls.ts
- apps/cli/src/commands/cli/list.ts
- webview-ui/src/components/chat/tests/TooManyToolsWarning.spec.tsx
- webview-ui/src/components/settings/useSettingsSearch.ts
- .github/workflows/cli-release.yml
- src/api/providers/fetchers/modelEndpointCache.ts
- src/integrations/misc/read-lines.ts
- apps/cli/scripts/build.sh
- apps/cli/src/agent/message-processor.ts
- webview-ui/src/components/chat/SlashCommandItemSimple.tsx
- src/package.json
- src/integrations/misc/line-counter.ts
- webview-ui/src/components/common/tests/DismissibleUpsell.spec.tsx
- src/shared/modes.ts
- apps/cli/src/ui/App.tsx
- src/core/tools/UpdateTodoListTool.ts
- src/api/providers/fetchers/versionedSettings.ts
- src/eslint-suppressions.json
- packages/build/src/types.ts
- apps/cli/src/ui/components/Header.tsx
- src/core/auto-approval/commands.ts
- apps/cli/src/ui/theme.ts
🚧 Files skipped from review as they are similar to previous changes (39)
- src/api/transform/vscode-lm-format.ts
- webview-ui/src/hooks/useTooManyTools.ts
- apps/cli/src/ui/components/Icon.tsx
- apps/cli/src/lib/storage/credentials.ts
- src/core/webview/ClineProvider.ts
- src/api/providers/utils/image-generation.ts
- src/shared/parse-command.ts
- webview-ui/src/components/chat/ErrorRow.tsx
- webview-ui/package.json
- webview-ui/src/components/chat/tests/WarningRow.spec.tsx
- src/services/code-index/shared/validation-helpers.ts
- src/utils/WorkspacePathResolver.ts
- apps/cli/src/lib/task-history/index.ts
- webview-ui/src/utils/format.ts
- webview-ui/src/components/chat/WarningRow.tsx
- webview-ui/src/utils/sourceMapUtils.ts
- src/utils/config.ts
- src/core/message-queue/MessageQueueService.ts
- src/api/transform/reasoning.ts
- webview-ui/src/components/chat/tests/ErrorRow.spec.tsx
- src/services/tree-sitter/queries/scala.ts
- apps/cli/src/agent/extension-client.ts
- apps/cli/src/lib/storage/settings.ts
- webview-ui/src/utils/tests/path-mentions.spec.ts
- src/services/command/built-in-commands.ts
- apps/cli/package.json
- src/services/code-index/semble/semble-downloader.ts
- src/utils/networkProxy.ts
- src/services/code-index/interfaces/manager.ts
- src/api/providers/openai-compatible.ts
- src/api/providers/lm-studio.ts
- src/api/providers/fetchers/openrouter.ts
- src/services/roo-config/index.ts
- webview-ui/src/components/settings/utils/tests/headers.spec.ts
- src/integrations/misc/extract-text.ts
- src/services/tree-sitter/index.ts
- knip.json
- src/shared/tools.ts
- src/core/prompts/tools/filter-tools-for-mode.ts
Closes #519
What problem this solves
Knip now has a production-mode configuration that accurately models the VS Code extension, webview, CLI, and package workspaces. This PR also cleans up the dead production code surfaced by that stricter graph and removes the warning-only Knip policy so future unused exports, enum members, duplicate exports, and type exports fail CI instead of being tolerated.
What changed
Knip configuration
entryandprojectpatterns using Knip's!suffix for production source graphs.duplicates,enumMembers,exports,nsExports,types, andnsTypes; onlyclassMembersremains off.@internaland deliberate public compatibility surface with@public.Dead production code removed
BatchListFilesPermissionSlashCommandItemSimpleTooManyToolsWarningDismissibleUpsellOpenAICompatibleHandlerimplementation to the remaining public config type.Exports and dependency cleanup
apps/cli'sexecadependency todevDependenciesbecause it is used by integration scripts.@tailwindcss/vitetowebview-uidev dependencies because it is build tooling.srcpackage dependencies tied to deleted code:@ai-sdk/openai-compatiblesemver-compare@types/semver-compare.test.tsto.spec.tsso Knip/Vitest discover them consistently.Verification
pnpm exec knippnpm exec knip --productionpnpm --filter ./src check-typespnpm --filter @roo-code/vscode-webview check-typespnpm --filter @roo-code/cli check-typespnpm --filter @roo-code/core check-typespnpm --filter @roo-code/types check-typespnpm --filter @roo-code/vscode-shim check-typespnpm --filter @roo-code/vscode-webview test -- ErrorRow.spec.ts WarningRow.spec.ts TranslationContext.spec.tsx ChatView.scroll-debug-repro.spec.tsxNote: the webview test command runs the package
pretest, which bundles first, then executed the full webview suite successfully.Summary by CodeRabbit