Repository navigation
fix(web): merge wide script analysis results without call spreads - #10446
Closed
viniciusdsandrade wants to merge 2 commits into
Closed
viniciusdsandrade wants to merge 2 commits into
viniciusdsandrade wants to merge 2 commits into
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryReplaces five call-spread appends with an item-by-item helper, avoiding JavaScript call-argument limits while keeping item order.
Reviews (2) · Last reviewed commit: "test(web): use valid script_key format i..." · Reviewed by Greptile |
This was referenced Nov 14, 2026
N0zoM1z0
pushed a commit
that referenced
this pull request
Nov 14, 2026
Fixes #10445 Supersedes #10446 Co-Authored-By: gensokyo-dev <[email protected]>
Collaborator
|
Thank you for this fix. It landed in #10539 with your authorship kept on the commit, so I'm closing this PR as superseded. |
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
Closes #10445
mergeScriptResultsinsrc/domain/webBundleAnalyzerResult.tsmerged each analyzed script'sedges,routes,endpoints,webmcp_declarations, andinferencesinto the shared accumulator usingpush(...items). When any single script result exceeded JavaScript's call-argument stack capacity (for example 130,000 items on a V8 main-thread stack or ~65k on Bun/JSC),buildCapturedWebBundleAnalysisthrewRangeError: Maximum call stack size exceeded.Problem and expected behavior
Smallest trigger: passing an analyzed
WebBundleScriptAnalysiscontaining 130,000 items inobservations.edges,observations.routes,observations.endpoints,observations.webmcp_declarations, orinferencestobuildCapturedWebBundleAnalysis.Violated invariant: merging valid per-script analysis outputs must not fail with a call-frame argument limit
RangeErrorinside result aggregation.Expected behavior: append all five collections iteratively through a small shared helper so
buildCapturedWebBundleAnalysispreserves every item in order beyond engine call-argument limits (matching sibling fixes#10362and#10386).Change and scope
appendAllhelper insrc/domain/webBundleAnalyzerResult.tsand replaced the five.push(...)spread calls insidemergeScriptResults(lines 222-226on base).tests/boundary/browser/webBundleResultCapacity.test.tsin the forkedboundaryVitest project (sharing the CLI/MCP main-thread stack) verifyingbuildCapturedWebBundleAnalysispreserves 130,000 items for each ofedges,routes,endpoints,webmcp_declarations, andinferences.mergeScriptResultsand forked boundary regression test; sibling worker protocol byte caps (JAVASCRIPT_STATIC_FACT_BYTES) are unchanged.Contract and boundary impact
mergeScriptResultsinsrc/domain/webBundleAnalyzerResult.tsowns per-script result aggregation intoWebBundleAnalysis; public inputs and schema outputs are unchanged.RangeErroron wide analyzed script results across all supported Node.js/Bun platforms.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
tests/boundary/browser/webBundleResultCapacity.test.ts(parameterized acrossedges,routes,endpoints,webmcp_declarations, andinferencesat 130,000 items on a forked test stack).upstream/main(5815178a8) confirmed fiveaccumulator.*.push(...)spread calls inmergeScriptResults; CI verification pending on this draft PR.analyze_web_bundle/buildCapturedWebBundleAnalysiscompletes instead of throwingRangeError: Maximum call stack size exceededon wide analyzed script results.For evidence-bearing changes:
Validation performed
5815178a8- verified strict TypeScript types,noUncheckedIndexedAccesshandling,switchexhaustiveness, and formatting alignment; waiting for GitHub Actions CI checks.Compatibility, safety, and release
buildCapturedWebBundleAnalysison Node.js main-thread stacks; live Chromium end-to-end capture with 130k synthetic observations was not run locally.Author readiness
Human owner:
Before merge
type(scope): outcome.