Commit cfda839
feat: auto-omit MCP content when no servers are configured (#5889)
* feat: auto-omit MCP content when no servers are configured
- Modify system prompt generation to detect when no MCP servers are defined
- Only include MCP sections when mode has mcp group AND servers exist
- Pass undefined mcpHub to capabilities and tools when no servers available
- Reduces system prompt verbosity when MCP functionality is not in use
* fix: add missing Uri and RelativePattern exports to VSCode mocks
- Added Uri and RelativePattern exports to global VSCode mock in __mocks__/vscode.js
- Fixed McpHub.spec.ts VSCode mock to include Uri and RelativePattern
- Fixed Task.spec.ts VSCode mock to include Uri and RelativePattern with proper TypeScript typing
- Resolves unhandled rejection errors in unit tests caused by missing VSCode API mocks
* fix: add proper TypeScript typing for RelativePattern in McpHub test mock
* fix: resolve unit test failures in PR #5889
- Fix VSCode mock onDidChangeWorkspaceFolders to accept callback parameter
- Update MCP test mocks to properly test auto-omit functionality
- Update test snapshots to reflect new MCP content omission behavior
- All core functionality tests now passing
* chore: remove package-lock.json as project uses npm
* fix: remove unrelated mock changes from PR
---------
Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Daniel Riccio <[email protected]>1 parent de13d8a commit cfda839
File tree
7 files changed
+17
-75
lines changed- src
- core/prompts
- __tests__
- __snapshots__
- add-custom-instructions
- system-prompt
- services/mcp/__tests__
7 files changed
+17
-75
lines changedsrc/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap
Lines changed: 0 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | | - | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
96 | | - | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | | - | |
| 112 | + | |
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
0 commit comments