Repository navigation
perf(browser): bound retained network body verification memory - #12231
Merged
morluto merged 1 commit intoNov 19, 2026
Merged
Conversation
ShuaixinHuang
marked this pull request as ready for review
November 19, 2026 05:45
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryThe PR verifies retained network bodies in 64 KiB base64 windows instead of decoding and re-encoding the whole body at once.
Reviews (2) · Last reviewed commit: "perf(browser): bound memory for retained..." · Reviewed by Greptile |
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.
Summary
Verify retained browser network bodies in complete base64 quartets, 64 KiB of encoded text at a time. A window's decoded bytes supply both its canonical spelling check and the accumulated count and SHA-256. Retain the existing validation for count and digest after canonical spelling succeeds. Stop on invalid spelling and report that issue before interpreting the body.
Evidence
The browser body, scenario capture, imported network capture, network view, and Playwright content suites passed all 98 tests. Added cases check validity across a window with a padded tail, a changed byte on the boundary, and padding followed by another window.
Standalone Linux/Node 24.22.1 measurements timed the integrity check over a synthetic 4 MiB plus one byte body. Each version ran in a separate process. The first check took 32.5 ms before and 5.6 ms after. The next 40 checks took 472.1 ms and 163.3 ms elapsed, 505.2 ms and 168.8 ms CPU time, and peak RSS was 127,476 KiB and 52,208 KiB. At the default 64 KiB retained-body size, 40 checks took 4.3 ms before and 4.8 ms after with similar RSS. The benchmark measures the validation step only. It does not measure browser capture, full request latency, or agent tokens.
Author readiness
Human owner: @ShuaixinHuang
Before merge