Report the exec-server release version in environment info (#42270)

## Why

Clients need the executor's release version to make version-based compatibility decisions.

## What changed

- Add `executorVersion` to `EnvironmentInfo` and return it from both `initialize` and `environment/info`.
- Resolve the package release version at process startup so the advertised value remains stable for the server's lifetime.
- Use `0.0.0` when the version is unknown or omitted by a legacy executor.

## Testing

- Cover packaged and source-build initialization, startup caching, protocol serialization, and client-side metadata caching.

GitOrigin-RevId: a0c7f0b701a8e7e50345cd5fb1b5c5d2d38ff3b1
This commit is contained in:
felixxia-oai
2026-09-02 12:07:32 +00:00
committed by copyberry
parent a0dcfe2ada
commit 8d32abcd01
15 changed files with 131 additions and 28 deletions
+3
View File
@@ -157,6 +157,7 @@ Response:
"sessionId": "00000000-0000-4000-8000-000000000001",
"environmentInfo": {
"shell": { "name": "bash", "path": "/bin/bash" },
"executorVersion": "1.2.3-alpha.4",
"cwd": "file:///workspace"
}
}
@@ -165,6 +166,8 @@ Response:
`environmentInfo` contains the same executor metadata returned by
`environment/info`, so clients can use it without a second request.
`executorVersion` is the executor's package release version, or `0.0.0` when unknown.
Rust clients cache this metadata for the client's lifetime, including session
resumption. If initialization omits it, the first metadata request fetches and
caches `environment/info`.