Commit ca27bbb
committed
fix: prevent MCP server restart when toggling tool permissions
- Added isProgrammaticUpdate flag to track when config changes are made programmatically
- Modified debounceConfigChange to skip file watcher triggers during programmatic updates
- Updated updateServerToolList to set the flag when writing config changes
- Updated updateServerConfig to handle minor updates (alwaysAllow, disabledTools, timeout) without triggering restarts
- Added small delay after programmatic writes to ensure file watchers process the flag
This prevents unnecessary server restarts when users toggle the 'Always allow' checkbox
for MCP tools, improving the user experience by maintaining active connections.
Fixes #82311 parent 0e1b23d commit ca27bbb
1 file changed
+40
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
281 | 287 | | |
282 | 288 | | |
283 | 289 | | |
| |||
1463 | 1469 | | |
1464 | 1470 | | |
1465 | 1471 | | |
1466 | | - | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
1467 | 1494 | | |
1468 | 1495 | | |
1469 | 1496 | | |
| |||
1686 | 1713 | | |
1687 | 1714 | | |
1688 | 1715 | | |
1689 | | - | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1690 | 1728 | | |
1691 | 1729 | | |
1692 | 1730 | | |
| |||
0 commit comments