Fix skill toggle and MCP tools config storage scopes#2380
Fix skill toggle and MCP tools config storage scopes#2380VellummyilumVinoth wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 32 minutes and 36 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (23)
📝 WalkthroughWalkthroughThe PR removes the ChangesSkills and MCP Config Migration to VS Code Settings
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@workspaces/ballerina/ballerina-extension/src/features/ai/activator.ts`:
- Around line 281-307: The `set` and `delete` methods currently clear the entire
global MCP configuration when performing workspace-scoped writes by setting
'mcp' to undefined in the Global scope. Instead of this wholesale clear, perform
per-key cleanup by retrieving the global MCP configuration, removing only the
specific scopedKey from both enabledServers and disabledServers arrays in the
global scope, and then updating only those arrays. Apply this per-key removal
logic to both the `set` and `delete` methods to prevent users from losing
unrelated global MCP preferences when toggling a single server in a workspace
scope.
In
`@workspaces/ballerina/ballerina-extension/src/features/ai/agent/tools/skill-tool/skill-writer.ts`:
- Around line 28-33: The wsSkills assignment on line 33 unconditionally reads
from di?.workspaceValue even when projectRootPath is null, which allows
workspace overrides to leak into the global-only fallback path. Gate the
workspace settings access on the projectRootPath variable by only reading
di?.workspaceFolderValue and di?.workspaceValue when projectRootPath is not
null, otherwise set wsSkills to null to ensure the global-only behavior is
preserved when no project context is available.
In
`@workspaces/ballerina/ballerina-extension/src/rpc-managers/ai-panel/rpc-manager.ts`:
- Around line 1023-1027: The resolvedScope determination at line 1023 only
considers whether projectRootPath exists, but this can incorrectly scope user
skills to workspace settings instead of global settings. Before determining the
scope, classify whether the skill being enabled is a user skill or a builtin
skill. If the skill is a user skill, explicitly set resolvedScope to 'user' to
ensure it is saved to global settings. If the skill is a builtin skill, then
apply the existing projectRootPath logic to determine whether scope should be
'workspace' or 'user'. Update the conditional logic around the resolvedScope
assignment and the two setSkillEnabled calls to account for this skill type
classification.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 05e2e8e4-1562-45ed-a9da-5d73fa0e3d8a
📒 Files selected for processing (10)
workspaces/ballerina/ballerina-core/src/rpc-types/ai-panel/index.tsworkspaces/ballerina/ballerina-core/src/rpc-types/ai-panel/interfaces.tsworkspaces/ballerina/ballerina-core/src/rpc-types/ai-panel/rpc-type.tsworkspaces/ballerina/ballerina-extension/package.jsonworkspaces/ballerina/ballerina-extension/src/features/ai/activator.tsworkspaces/ballerina/ballerina-extension/src/features/ai/agent/skills/context.tsworkspaces/ballerina/ballerina-extension/src/features/ai/agent/tools/skill-tool/skill-writer.tsworkspaces/ballerina/ballerina-extension/src/rpc-managers/ai-panel/rpc-handler.tsworkspaces/ballerina/ballerina-extension/src/rpc-managers/ai-panel/rpc-manager.tsworkspaces/ballerina/ballerina-rpc-client/src/rpc-clients/ai-panel/rpc-client.ts
💤 Files with no reviewable changes (4)
- workspaces/ballerina/ballerina-core/src/rpc-types/ai-panel/interfaces.ts
- workspaces/ballerina/ballerina-core/src/rpc-types/ai-panel/rpc-type.ts
- workspaces/ballerina/ballerina-rpc-client/src/rpc-clients/ai-panel/rpc-client.ts
- workspaces/ballerina/ballerina-core/src/rpc-types/ai-panel/index.ts
767c693 to
3cf6ba2
Compare
3cf6ba2 to
b32fda1
Compare
Description
Corrects which settings file each Copilot UI toggle writes to:
settings.json. These are personal preferences and must not appear in.vscode/settings.json./slash-command skills) and PROJECT skills — written to.vscode/settings.json(workspace scope) when a project is open, falling back to global when no workspace is open.settings.json. Enabling MCP tools is a user-wide preference, not project-specific.Also adds bidirectional stale-entry cleanup in
setSkillEnabled: when a toggle writes to workspace scope it removes any prior entry for that skill from global settings, and vice versa. This prevents the same skill key from appearing in both files simultaneously, which caused confusing duplicates after the storage layer was migrated.Goals
Approach
UI Component Development
npm run storybookfrom the root directory to view current components.Manage Icons
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning
Summary by CodeRabbit
New Features
Chores
ballerina.ai.showContextUsagetoballerina.copilot.showContextUsage.resourcescope.