fix(amazonq): Fixes mcp server registry not clearing on switching connections and reduces GetProfile calls#2580
fix(amazonq): Fixes mcp server registry not clearing on switching connections and reduces GetProfile calls#2580shruti0085 wants to merge 8 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2580 +/- ##
==========================================
- Coverage 60.58% 60.58% -0.01%
==========================================
Files 278 278
Lines 65062 65078 +16
Branches 4145 4146 +1
==========================================
+ Hits 39420 39425 +5
- Misses 25558 25568 +10
- Partials 84 85 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| try { | ||
| // note: use dynamic require to satisfy webpack requirements for webworker | ||
| const McpManager = eval('require')('./mcpManager').McpManager | ||
| if (McpManager.isInitialized()) { |
There was a problem hiding this comment.
what happens when no mcpManager initialized yet?
There was a problem hiding this comment.
should default to false mcp state right? As mentioned offline, there is not an accessible way to use mcp manager without initialization and since it is the source for resolving servers, it seems reasonable for it have no servers. I believe even with my change that default behavior should not change as this is surrounded by a try catch
Description
This changes addresses to issues:
GetProfilecalls may get invoked a large number of times when service returned 5xx errors. With this change an attempt has been made to reduce the number of timeGetProfilecall may get invoked by theprofileStatusMonitor.IsMcpEnabeldcall.Testing
Validated that less IsMcpEnabled calls are invoked and mcp servers are cleared on switching connections
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.