mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
Rename environment process accessor to get_executor
Drop the stale remote_exec_server_client() accessor now that Environment exposes the process capability directly, and rename the capability getter to get_executor() on the environment trait and concrete type. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -56,5 +56,5 @@ pub trait ExecProcess: Send + Sync {
|
||||
|
||||
/// Capability bundle exposed by an execution environment.
|
||||
pub trait ExecutorEnvironment: Send + Sync {
|
||||
fn process(&self) -> &(dyn ExecProcess + '_);
|
||||
fn get_executor(&self) -> &(dyn ExecProcess + '_);
|
||||
}
|
||||
|
||||
@@ -53,15 +53,7 @@ impl Environment {
|
||||
self.experimental_exec_server_url.as_deref()
|
||||
}
|
||||
|
||||
pub fn remote_exec_server_client(&self) -> Option<&ExecServerClient> {
|
||||
if self.experimental_exec_server_url.is_some() {
|
||||
Some(&self.exec_server_client)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process(&self) -> &(dyn ExecProcess + '_) {
|
||||
pub fn get_executor(&self) -> &(dyn ExecProcess + '_) {
|
||||
&self.exec_server_client
|
||||
}
|
||||
|
||||
@@ -75,8 +67,8 @@ impl Environment {
|
||||
}
|
||||
|
||||
impl ExecutorEnvironment for Environment {
|
||||
fn process(&self) -> &(dyn ExecProcess + '_) {
|
||||
self.process()
|
||||
fn get_executor(&self) -> &(dyn ExecProcess + '_) {
|
||||
self.get_executor()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +82,5 @@ mod tests {
|
||||
let environment = Environment::create(None).await.expect("create environment");
|
||||
|
||||
assert_eq!(environment.experimental_exec_server_url(), None);
|
||||
assert!(environment.remote_exec_server_client().is_none());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user