From e2e504d12b15f8ae72240f59d656da19be4e971f Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sat, 26 Sep 2026 19:54:43 +0530 Subject: [PATCH] refactor(mcp): judge stale overlays from the same config the digest was resolved from The stale-overlay loop re-derived each name's config by hand (`servers` first, else the profile config) right next to `resolved_ids`, which is keyed off `judged`. Two copies of one precedence rule means an edit to either lets the static config and the resolved digest compared in `_same_server_route` come from different sources. Read both from `judged`. --- tools/mcp_tool_registration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mcp_tool_registration.py b/tools/mcp_tool_registration.py index 6d3a081ae0..f7af32cf69 100644 --- a/tools/mcp_tool_registration.py +++ b/tools/mcp_tool_registration.py @@ -517,10 +517,10 @@ def _register_connected_into_current_scope(servers: dict) -> int: if scope not in scopes: continue name = _key_name(key) - if name not in servers and name not in omitted: + if name not in judged: continue # attached after the config read; the next pass judges it server = _core._servers.get(key) - config = servers[name] if name in servers else profile_servers.get(name) + config = judged[name] cross_profile = _key_scope(key) != scope if (config is None or not mcp_server_enabled(config) or server is None or getattr(server, "session", None) is None