fix(server): report 2025-era client identity and features in binary_session

binary_session read the client's identity, protocol revision, and
capabilities only from the 2026-era per-request envelope. A 2025-era
connection sends none, so every such client was reported as `client: null`
with no negotiated protocol and no features, although it declared them in
`initialize`.

When a request carries no envelope, read the values the SDK keeps from the
connection's initialize handshake. An envelope still takes precedence.

Fixes #1167

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-09 03:20:43 +00:00
co-authored by Claude Opus 5.5
parent b4927a0a4f
commit b8312fa8d1
4 changed files with 122 additions and 11 deletions
+4 -2
View File
@@ -44,8 +44,10 @@ export const registerSessionStatusTool = (
contract.name,
toolRegistrationOptions(contract),
async (input, context) => {
const { client, clientFeatures, protocolVersion } =
mcpClientMetadata(context);
const { client, clientFeatures, protocolVersion } = mcpClientMetadata(
context,
server.server,
);
let androidAvailability: ProviderAvailability;
try {
androidAvailability = await androidAnalysisAvailability(