Skip to content

The agent that grows with you

refactor(mcp): declare _resolved_identity in MCPServerTask's slots and init it

kshitijk4poor684f7e992747
diff --git a/tools/mcp_tool.py b/tools/mcp_tool.py
index 81b5513f441..d1865e446f2 100644
--- a/tools/mcp_tool.py
+++ b/tools/mcp_tool.py
@@ -317,7 +317,7 @@ class MCPServerTask(MCPServerRunMixin, MCPServerTransportMixin, MCPServerHealthM
"_recycled_reason", "initialize_result", "_ping_unsupported", "_list_cache_meta",
"_reconnect_retries", "_session_proven", "_was_parked", "_inflight_tasks", "_reconnecting",
"_suspect_reason", "_teardown_race", "_permanent_grace_used", "_stdio_child_pids",
- "_ever_connected", "_sse_fallback", "_park_reason", "_last_park_line")
+ "_ever_connected", "_sse_fallback", "_park_reason", "_last_park_line", "_resolved_identity")
def __init__(self, name: str):
self.name = name
@@ -358,6 +358,9 @@ class MCPServerTask(MCPServerRunMixin, MCPServerTransportMixin, MCPServerHealthM
# (revoked credentials, dead endpoint) that must not run the job tool-less forever.
self._park_reason: Optional[str] = None
self._last_park_line: Optional[str] = None # last park WARNING text; identical re-parks log at DEBUG
+ # Digest of the resolved inputs the transport last connected with; a cross-profile adopter
+ # must resolve the same digest in its own scope. None until the transport publishes it.
+ self._resolved_identity: Optional[str] = None
# In-flight RPC tasks so a deliberate teardown fails them fast; _reconnecting is True
# during that teardown so _track_inflight_rpc turns the cancel into a retryable error.
# In-flight RPC bookkeeping (#48069 salvage): user-visible requests registered while running so a