You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: cap unbounded file reads in FileModel to prevent multi-GB memory spikes (APP-5343)
FileModel::open and FileModel::read_content_for_file (crates/warp_files)
called async_fs::read_to_string with no size check, so opening a
pathologically large file (e.g. a multi-gigabyte log or binary opened by
mistake) allocated memory proportional to the file's size. A Sentry memory
alert captured a single 8 GB allocation from exactly this call stack.
Add FileLoadError::TooLarge and a MAX_LOADABLE_FILE_SIZE_BYTES (100 MB) cap
enforced via a new FileModel::check_not_too_large helper, applied before
every unbounded read_to_string call site (open, read_content_for_file, and
the file-watcher auto-reload path). Surface a specific, actionable toast
message in the code editor when a file is rejected for being too large.
Co-Authored-By: Warp Agent <agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
0 commit comments