Carry `capabilities.extensions` on legacy `initialize` handshakes
Merged
KL
25d ago+58+58+01234567890123456789-22-22-01234567890123456789
Closes #3773.
On connections that negotiate 2025-11-25 or earlier, serialize_server_result("initialize", ...) sieves the result through the 2025 wire model, which has no extensions field, so a server could never advertise an extension (e.g. MCP Apps) to a legacy client.
scripts/gen_surface_types.py: add a schema patch that gives the 2025-11-25ClientCapabilities/ServerCapabilitiesan optionalextensionsmap, and regenerate_v2025_11_25.patch_schemanow acceptsold=Noneto mean "key absent".Server.create_initialization_optionsno longer forwardsself.extensionsdirectly;get_capabilitiesalready defaults to it and maps an empty dict toNone, so servers without extensions still send noextensionskey.- Flip the three "pinned gap" tests to assert the map survives a legacy handshake, add an
initializeround-trip test per pre-2026 version, and updatedocs/advanced/extensions.md.
AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.