Repository navigation
Conversation
The fixture's five inline scripts only assigned a boolean, so nothing referenced them once they had run. V8 may collect such a script, and a collected script is not replayed as scriptParsed to a later capture, each of which opens its own Debugger session. The later MCP capture then saw scripts=0. Each script now leaves a function behind. Annotations, budget and assertions are unchanged. Fixes morluto#3006
Codex Review SummaryThis 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. |
|
Own service-worker CDP registrations and retry failed teardown. Admit redaction and network metadata against remaining capture capacity, retain explicit omission reasons, and preserve source URL, redirect ancestry, caller-selected content, and historical capture values. Forward CLI cancellation through provider cleanup. Reviewed fixes: #2263, #2637, #2767, #2845, #2859, #2863, #2872, #2874, #2876, #2879, #2955, #2957, #2961, #3033. Validation: 25 current event/network source tests passed; earlier focused browser lanes passed 201 source tests and 176 boundary tests with two skips, plus 35 Python tests. Real browser/Windows lanes were not rerun. Playwright allocation before admission remains unbounded by these retention limits.
|
CI-fix track: this change is already on main. f690571 lists #3033 among its reviewed fixes and makes the identical fixture change: each script assigns |
|
Addressed on main in f690571; thank you @bercedev for the contribution. The exact fixture change is on main: each large inline script leaves a function reachable so V8 cannot collect it before independent later debugger sessions. The PR's forced-GC reproduction showed baseline failure and patched fixture success (3/3), preserving budget/assertions. Validation: Main verifier fixture: scripts/lib/browser-capture-metadata-budget-e2e.mjs; PR recorded 3/3 shipped runs and a forced HeapProfiler.collectGarbage reproduction (baseline failed 3/3, fixed fixture passed 3/3). Remaining diff: This PR has a single fixture-file change and that exact behavior is already committed. No production code or separate dependency change remains. Verification scope: PR's verification used Chromium 155 on Linux; the originally reported Windows/Edge scenario was not run. The PR itself states that the shipped fixture has no forced-GC call. Current whole-main CI qualification remains in progress. |
Fixes #3006.
Problem
browser-capture-metadata-budget-e2e.mjsserves a page with five 2 MiB inline scripts and then runs four independent captures against it: CLI inspect, CLI bundle, MCP inspect, MCP bundle. Each script only didglobalThis[marker] = true, so once it had run nothing referenced it. V8 is free to collect such a script, and a collected script is not replayed asscriptParsedto a later capture, since each capture opens its own Debugger session. The later MCP capture then saw no scripts and the fixture failed withscripts=0, retained_maps=0, excluded=undefined.Change
Each script now leaves a function behind (
globalThis[marker] = () => true), which keeps the script alive for the whole CLI/MCP sequence. The five full-sizesourceMappingURLannotations, the 10 MiB of declared metadata, the admission budget and every assertion are unchanged. No production code is touched.Verification
I could not reproduce the failure by just running the fixture on Linux (it passed 3 of 3), so I forced the condition the issue describes: a copy of the fixture that sends
HeapProfiler.collectGarbageto the page right before the MCP phase. The shipped fixture file has no such call.Chromium 155.0.8059.39 (Debian bookworm, headless,
--no-sandbox), Node 24.21.0, in a container, afternpm ciandnpm run build:cached:main(boolean)scripts=0, retained_maps=0, excluded=undefinedscripts=5, retainedMaps=1, omittedMaps=4The failure text is the one from the issue.
Checks run on the changed file:
oxfmt --checkclean,oxlint0 errors (2 warnings, both there before this change).Not run:
npm run check, the fullverify:browsercomposite, and anything on Windows or Edge, which is where the issue was observed. I droveverifyBrowserCaptureMetadataBudgetdirectly with a small launcher instead of the composite.The issue also asks to look at other fixtures for the same multi-capture lifetime assumption. I did not do that here; this PR is only the fixture named in the report.
Note: I used Claude Code while working on this. I ran the reproduction and the checks above myself.