mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
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:
@@ -158,7 +158,7 @@ impl ExecServerHandler {
|
||||
.unwrap_or_else(std::sync::PoisonError::into_inner) = Some(session);
|
||||
Ok(InitializeResponse {
|
||||
session_id,
|
||||
environment_info: Some(EnvironmentInfo::local()),
|
||||
environment_info: Some(super::release_version::local_environment_info()),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ impl ExecServerHandler {
|
||||
|
||||
pub(crate) fn environment_info(&self) -> Result<EnvironmentInfo, JSONRPCErrorError> {
|
||||
self.require_initialized_for("environment info")?;
|
||||
Ok(EnvironmentInfo::local())
|
||||
Ok(super::release_version::local_environment_info())
|
||||
}
|
||||
|
||||
pub(crate) async fn environment_config_read(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
|
||||
use codex_build_info::BuildInfo;
|
||||
use codex_exec_server_protocol::JSONRPCMessage;
|
||||
use tokio::sync::mpsc;
|
||||
use tracing::debug;
|
||||
@@ -53,6 +54,8 @@ impl ConnectionProcessor {
|
||||
http_client_factory: HttpClientFactory,
|
||||
request_dispatch_mode: RequestDispatchMode,
|
||||
) -> Self {
|
||||
// Library callers may bypass CLI startup. Capture the version before serving clients.
|
||||
let _ = BuildInfo::get();
|
||||
Self {
|
||||
session_registry: SessionRegistry::new(telemetry.clone()),
|
||||
runtime_paths,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//! Include the startup-cached package release version in executor metadata.
|
||||
|
||||
use codex_build_info::BuildInfo;
|
||||
|
||||
use crate::protocol::EnvironmentInfo;
|
||||
|
||||
pub(super) fn local_environment_info() -> EnvironmentInfo {
|
||||
EnvironmentInfo {
|
||||
executor_version: BuildInfo::get().version().to_string(),
|
||||
..EnvironmentInfo::local()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user