mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Use raw values for filesystem RPC batches
This commit is contained in:
@@ -42,7 +42,6 @@ pub use codex_file_system::CopyOptions;
|
||||
pub use codex_file_system::CreateDirectoryOptions;
|
||||
pub use codex_file_system::ExecutorFileSystem;
|
||||
pub use codex_file_system::ExecutorFileSystemFuture;
|
||||
pub use codex_file_system::ExecutorRpcBatchResult;
|
||||
pub use codex_file_system::FILE_READ_CHUNK_SIZE;
|
||||
pub use codex_file_system::FileMetadata;
|
||||
pub use codex_file_system::FileSystemReadStream;
|
||||
|
||||
@@ -9,7 +9,6 @@ use crate::CreateDirectoryOptions;
|
||||
use crate::ExecServerError;
|
||||
use crate::ExecutorFileSystem;
|
||||
use crate::ExecutorFileSystemFuture;
|
||||
use crate::ExecutorRpcBatchResult;
|
||||
use crate::FileMetadata;
|
||||
use crate::FileSystemReadStream;
|
||||
use crate::FileSystemResult;
|
||||
@@ -228,7 +227,7 @@ impl RemoteFileSystem {
|
||||
async fn execute_rpc_batch(
|
||||
&self,
|
||||
calls: Vec<(String, serde_json::Value)>,
|
||||
) -> FileSystemResult<Vec<ExecutorRpcBatchResult>> {
|
||||
) -> FileSystemResult<Vec<FileSystemResult<serde_json::Value>>> {
|
||||
let client = self.client.get().await.map_err(map_remote_error)?;
|
||||
Ok(client
|
||||
.call_batch(calls)
|
||||
@@ -329,7 +328,7 @@ impl ExecutorFileSystem for RemoteFileSystem {
|
||||
fn execute_rpc_batch<'a>(
|
||||
&'a self,
|
||||
calls: Vec<(String, serde_json::Value)>,
|
||||
) -> ExecutorFileSystemFuture<'a, Vec<ExecutorRpcBatchResult>> {
|
||||
) -> ExecutorFileSystemFuture<'a, Vec<FileSystemResult<serde_json::Value>>> {
|
||||
Box::pin(RemoteFileSystem::execute_rpc_batch(self, calls))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,8 +166,6 @@ pub type FileSystemResult<T> = io::Result<T>;
|
||||
pub type ExecutorFileSystemFuture<'a, T> =
|
||||
Pin<Box<dyn Future<Output = FileSystemResult<T>> + Send + 'a>>;
|
||||
|
||||
pub type ExecutorRpcBatchResult = FileSystemResult<serde_json::Value>;
|
||||
|
||||
/// Stream of immutable chunks read from an [`ExecutorFileSystem`].
|
||||
pub struct FileSystemReadStream {
|
||||
inner: Pin<Box<dyn Stream<Item = FileSystemResult<Bytes>> + Send + 'static>>,
|
||||
@@ -271,7 +269,7 @@ pub trait ExecutorFileSystem: Send + Sync {
|
||||
fn execute_rpc_batch<'a>(
|
||||
&'a self,
|
||||
_requests: Vec<(String, serde_json::Value)>,
|
||||
) -> ExecutorFileSystemFuture<'a, Vec<ExecutorRpcBatchResult>> {
|
||||
) -> ExecutorFileSystemFuture<'a, Vec<FileSystemResult<serde_json::Value>>> {
|
||||
Box::pin(async {
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Unsupported,
|
||||
|
||||
Reference in New Issue
Block a user