* fix(mcp): invalidate tool prompt cache on connect/disconnect/error get_tool_descriptions_for_prompt cached its result keyed only on (disabled_map, len(_tools)). If a server reconnects with the same tool count (or transitions to error state), the cache was never busted — the agent received stale tool descriptions for the new connection state. Add a _generation counter incremented on every structural change (successful connect, disconnect, connection error) and include it in the cache key. * test(mcp): regression test for _generation cache invalidation
2.8 KiB
2.8 KiB