mirror of
https://github.com/openai/codex.git
synced 2026-09-29 16:57:06 +08:00
Advertise environment config read support (#37654)
## What changed - Add `environmentConfigRead` to exec-server environment capabilities and advertise it for local executors. - Default the capability to `false` when deserializing responses from older executors. ## Testing - Verify legacy capability responses remain compatible and the environment config integration reports support. GitOrigin-RevId: c2110fea9e0e6e756eaeaaad096c50a943668c99
This commit is contained in:
@@ -112,6 +112,9 @@ pub struct EnvironmentCapabilities {
|
||||
/// Whether capability discovery applies the filesystem sandbox sent with each root.
|
||||
#[serde(default)]
|
||||
pub capability_discovery_sandbox: bool,
|
||||
/// Whether this executor supports the `environmentConfig/read` request.
|
||||
#[serde(default)]
|
||||
pub environment_config_read: bool,
|
||||
}
|
||||
|
||||
/// Status returned by an initialized exec-server connection.
|
||||
@@ -169,6 +172,7 @@ impl EnvironmentInfo {
|
||||
capabilities: EnvironmentCapabilities {
|
||||
network_proxy_launch: true,
|
||||
capability_discovery_sandbox: true,
|
||||
environment_config_read: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -903,6 +907,24 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn environment_capabilities_accept_legacy_response_without_environment_config_read() {
|
||||
let capabilities: EnvironmentCapabilities = serde_json::from_value(serde_json::json!({
|
||||
"networkProxyLaunch": true,
|
||||
"capabilityDiscoverySandbox": true,
|
||||
}))
|
||||
.expect("legacy environment capabilities should deserialize");
|
||||
|
||||
assert_eq!(
|
||||
capabilities,
|
||||
EnvironmentCapabilities {
|
||||
network_proxy_launch: true,
|
||||
capability_discovery_sandbox: true,
|
||||
environment_config_read: false,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn environment_info_preserves_executor_temporary_directories() {
|
||||
let expected = serde_json::json!({
|
||||
@@ -912,6 +934,7 @@ mod tests {
|
||||
"capabilities": {
|
||||
"networkProxyLaunch": false,
|
||||
"capabilityDiscoverySandbox": false,
|
||||
"environmentConfigRead": false,
|
||||
},
|
||||
});
|
||||
let info: EnvironmentInfo = serde_json::from_value(expected.clone())
|
||||
|
||||
Reference in New Issue
Block a user