Files
codex/codex-rs/tui
Felipe Coury eb1c5108a3 Reject oversized remote sidebar file previews before reading (#65022)
## Why

A remote preview can exceed the WebSocket client's 128 MiB message limit
once the file is base64-encoded and wrapped in a JSON-RPC response.

## What changed

Check the file size with `fs/getMetadata` before calling `fs/readFile` for
remote previews. Allow for base64 expansion and reserve room for the
JSON-RPC envelope. If the reported size exceeds that budget, show a
preview error with the file's size.

Continue with the read if the server lacks `fs/getMetadata` or omits
`sizeBytes`. Apply the sidebar's existing path error handling to metadata
failures as well as read failures.

## Testing

Extend the remote preview test to cover an image at the size limit,
oversized image and text files, and both metadata compatibility fallbacks.

GitOrigin-RevId: a284b3b76d9c56fe7e80445d880ccc17d575681c
2026-12-01 16:07:34 +00:00
..