Repository navigation
Fix/screenshots size cap - #488
Merged
gaurav-singh-9227 merged 3 commits intoOct 16, 2026
Merged
Conversation
fetchAutomationScreenshots had no size limit on any of its allocations,
so one call could grow a hosted pod by hundreds of MB (the sharp/libvips
pixel buffers traced in ai-common-infra-ops#125).
- Cap the /sessions/{id}/logs download at MAX_LOG_BYTES (5 MB on remote),
matching getFailureLogs on the same endpoint.
- Cap each screenshot download at 10 MB on remote; skip oversized ones and
return the rest, or explain if all are too large.
- In maybeCompressBase64, reject images over 25M px before decoding and
downscale to at most 1920 px on the long side.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Local stdio runs keep full-resolution screenshots and sharp's default pixel limit, matching the REMOTE_MCP gating of the download caps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
PR browserstack#481 and this branch both rewrote fetchAndCompress, so they could not be merged independently. This brings browserstack#481's changes onto the size-cap work: - parse DEBUG visual-log screenshots alongside test-initiated ones, anchored on the timestamped log prefix so a REQUEST cannot borrow a later RESPONSE - restrict screenshot URLs to https on BrowserStack, S3 and B2 hosts - detect the image mime type from the bytes, after compression: sharp re-encodes anything over 1 MB to PNG, so reading the original bytes would label a large JPEG wrongly - report the empty result as a debug-mode hint rather than an unexpected error Screenshot keeps both shapes: it carries mimeType and fetchAndCompress still returns null for an oversized download so the remaining screenshots load. The size-cap tests now use timestamped log lines and allowlisted https URLs, routed to the local server by the apiClient spy; the previous fixtures were written against the older permissive parser and would otherwise parse to no URLs at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gaurav-singh-9227
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.