mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Restore streaming read chunk limit
This commit is contained in:
@@ -133,7 +133,8 @@ impl FsRequestProcessor {
|
||||
connection_id: ConnectionId,
|
||||
params: FsReadFileOpenParams,
|
||||
) -> Result<FsReadFileOpenResponse, JSONRPCErrorError> {
|
||||
self.handles(connection_id)
|
||||
let max_chunk_bytes = self
|
||||
.handles(connection_id)
|
||||
.await
|
||||
.open_read(
|
||||
self.file_system()?,
|
||||
@@ -143,7 +144,10 @@ impl FsRequestProcessor {
|
||||
)
|
||||
.await
|
||||
.map_err(map_file_handle_error)?;
|
||||
Ok(FsReadFileOpenResponse {})
|
||||
Ok(FsReadFileOpenResponse {
|
||||
max_chunk_bytes: u32::try_from(max_chunk_bytes)
|
||||
.map_err(|_| internal_error("file read chunk limit exceeds u32"))?,
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) async fn read_file_read(
|
||||
|
||||
@@ -421,7 +421,7 @@ async fn fs_streaming_read_supports_stat_and_positional_reads() -> Result<()> {
|
||||
)
|
||||
.await??,
|
||||
)?;
|
||||
assert_eq!(open, FsReadFileOpenResponse {});
|
||||
assert!(open.max_chunk_bytes >= 4);
|
||||
|
||||
let wrong_type_id = mcp
|
||||
.send_raw_request(
|
||||
|
||||
Reference in New Issue
Block a user