mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:10:37 +00:00
Align exec-server handler naming and fs defaults
Restore the app-server fs default onto Environment::default(), bring back a sync local Environment default for that path, and rename the process RPC adapter to match the filesystem handler style. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -20,8 +20,8 @@ use codex_app_server_protocol::FsWriteFileResponse;
|
||||
use codex_app_server_protocol::JSONRPCErrorError;
|
||||
use codex_exec_server::CopyOptions;
|
||||
use codex_exec_server::CreateDirectoryOptions;
|
||||
use codex_exec_server::Environment;
|
||||
use codex_exec_server::ExecutorFileSystem;
|
||||
use codex_exec_server::LocalFileSystem;
|
||||
use codex_exec_server::RemoveOptions;
|
||||
use std::io;
|
||||
use std::sync::Arc;
|
||||
@@ -34,7 +34,7 @@ pub(crate) struct FsApi {
|
||||
impl Default for FsApi {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
file_system: Arc::new(LocalFileSystem),
|
||||
file_system: Arc::new(Environment::default().get_filesystem()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,15 @@ pub struct Environment {
|
||||
executor: Arc<dyn ExecProcess>,
|
||||
}
|
||||
|
||||
impl Default for Environment {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
experimental_exec_server_url: None,
|
||||
executor: Arc::new(LocalProcess::default()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Environment {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("Environment")
|
||||
|
||||
@@ -36,7 +36,7 @@ pub(crate) struct ExecServerFileSystem {
|
||||
impl Default for ExecServerFileSystem {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
file_system: Arc::new(Environment.get_filesystem()),
|
||||
file_system: Arc::new(Environment::default().get_filesystem()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,17 +25,17 @@ use crate::protocol::WriteParams;
|
||||
use crate::protocol::WriteResponse;
|
||||
use crate::rpc::RpcNotificationSender;
|
||||
use crate::server::filesystem::ExecServerFileSystem;
|
||||
use crate::server::process_handler::ProcessHandler;
|
||||
use crate::server::process_handler::ExecServerProcess;
|
||||
|
||||
pub(crate) struct ExecServerHandler {
|
||||
process: ProcessHandler,
|
||||
process: ExecServerProcess,
|
||||
file_system: ExecServerFileSystem,
|
||||
}
|
||||
|
||||
impl ExecServerHandler {
|
||||
pub(crate) fn new(notifications: RpcNotificationSender) -> Self {
|
||||
Self {
|
||||
process: ProcessHandler::new(notifications),
|
||||
process: ExecServerProcess::new(notifications),
|
||||
file_system: ExecServerFileSystem::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ use crate::protocol::WriteResponse;
|
||||
use crate::rpc::RpcNotificationSender;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(crate) struct ProcessHandler {
|
||||
pub(crate) struct ExecServerProcess {
|
||||
process: LocalProcess,
|
||||
}
|
||||
|
||||
impl ProcessHandler {
|
||||
impl ExecServerProcess {
|
||||
pub(crate) fn new(notifications: RpcNotificationSender) -> Self {
|
||||
Self {
|
||||
process: LocalProcess::new(notifications),
|
||||
|
||||
Reference in New Issue
Block a user