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:
Adam Perry @ OpenAI
2026-10-01 01:47:35 +00:00
committed by copyberry
parent cca440697f
commit c51f5bfb82
3 changed files with 32 additions and 0 deletions
@@ -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,