Skip to content

perf(browser): bound retained network body verification memory - #12231

Merged
morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:perf/browser-body-integrity-windows
Nov 19, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:perf/browser-body-integrity-windows

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Maintainer review and CI complete.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review November 19, 2026 05:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T05:48:25.190068Z 0e7e615 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

The PR verifies retained network bodies in 64 KiB base64 windows instead of decoding and re-encoding the whole body at once.

  • Browser network bodies are checked in 64 KiB windows.

Reviews (2) · Last reviewed commit: "perf(browser): bound memory for retained..." · Reviewed by Greptile

@ShuaixinHuang ShuaixinHuang changed the title perf(browser): bound memory for retained body verification perf(browser): bound retained network body verification memory Nov 19, 2026
@morluto
morluto merged commit 661dec7 into morluto:main Nov 19, 2026
40 of 41 checks passed
@morluto morluto added area: tests Test suite and verification performance Performance regressions, scaling limits, and bounded-resource work labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants