You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(mcp): resync /mcp gateway tools/list on connect, reconnect, and tool-sync drift
The gateway's tools/list served a stale snapshot rebuilt only on admin config
mutations (add/update/remove/enable/disable a client). Boot-time client dialing,
manual/health-monitor reconnects, and periodic tool-sync drift all mutated a
client's live ToolMap without ever triggering a resync, so /mcp could serve
{"tools":[]} indefinitely after a clean restart until an admin toggled a client.
Adds an onToolsUpdated hook on MCPManager, coalesced through a buffered channel
so bursts of concurrent connects collapse into at most one extra resync, fired
from connectToMCPClient and performSync only on their success paths. The
transport wires this to SyncAllMCPServers in Bootstrap, and Bifrost retains the
callback so it's re-applied to any MCPManager constructed later by a lazy-init
path (AddMCPClient, VerifyPerUserOAuthConnection, VerifyHeadersConnection,
SetMCPManager) for processes that start with no MCP configured.
Fixes#4998
mcpToolsUpdatedFnfunc() // Set by SetOnMCPToolsUpdated; applied to MCPManager at boot and re-applied to any manager created later by a lazy-init path (AddMCPClient, VerifyPerUserOAuthConnection, VerifyHeadersConnection), since those construct a fresh MCPManager that wouldn't otherwise see a hook set before it existed
92
94
dropExcessRequests atomic.Bool// If true, in cases where the queue is full, requests will not wait for the queue to be empty and will be dropped instead.
93
95
keySelector schemas.KeySelector// Custom key selector function
94
96
keyPoolFilter schemas.KeyPoolFilter// optional hook to veto keys before selection (nil = all eligible)
0 commit comments