mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
Handle unsupported fs/writeBlock requests in exec-server (#49811)
## What changed Register `fs/writeBlock` and require filesystem initialization before handling it. Validate the file handle ID, then return an invalid-request error stating that writable file streams are unsupported. GitOrigin-RevId: 13440e497a88ca6505ee60d95bbb771d3cae06b8
This commit is contained in:
committed by
copyberry
parent
cca440697f
commit
c51f5bfb82
@@ -50,6 +50,8 @@ use crate::protocol::FsRemoveParams;
|
||||
use crate::protocol::FsRemoveResponse;
|
||||
use crate::protocol::FsWalkParams;
|
||||
use crate::protocol::FsWalkResponse;
|
||||
use crate::protocol::FsWriteBlockParams;
|
||||
use crate::protocol::FsWriteBlockResponse;
|
||||
use crate::protocol::FsWriteFileParams;
|
||||
use crate::protocol::FsWriteFileResponse;
|
||||
use crate::protocol::HTTP_REQUEST_METHOD;
|
||||
@@ -340,6 +342,14 @@ impl ExecServerHandler {
|
||||
self.file_system.read_block(params).await
|
||||
}
|
||||
|
||||
pub(crate) async fn fs_write_block(
|
||||
&self,
|
||||
params: FsWriteBlockParams,
|
||||
) -> Result<FsWriteBlockResponse, JSONRPCErrorError> {
|
||||
self.require_initialized_for("filesystem")?;
|
||||
self.file_system.write_block(params).await
|
||||
}
|
||||
|
||||
pub(crate) async fn fs_close(
|
||||
&self,
|
||||
params: FsCloseParams,
|
||||
|
||||
Reference in New Issue
Block a user