Repository navigation
[PR] fix(web): keep long-session reports within the argument limit - #7404
Merged
ranxianglei merged 1 commit intoNov 20, 2026
Conversation
Reduce trajectory and recovery-window extrema without expanding retained ledger samples into individual function arguments. Preserve every plot point, reference axis, recovery floor and outlier threshold. The unchanged base fails both 200,000-sample regressions; the fixed branch passes all 15 report and large-ledger tests, typecheck, build and static gates. This follows the separate cache-bucket fix in ranxianglei#6689; the SVG exporter's extrema were not covered there.
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.
Fixes #7403
Problem
The cache ledger intentionally retains the full request history, but the SVG report passes every trajectory sample to
Math.max.apply. A valid 200,000-sample history throwsRangeError: Maximum call stack size exceededbefore the report can be downloaded.The same report's recovery chart has three more extrema calls that expand its full sample window into function arguments. Fixing only the trajectory would move the failure to that chart.
Change
Calculate the trajectory maximum and recovery-window extrema with reductions. Every trajectory point remains in the report. Window/system reference values, the prior-round floor, the 25% outlier filter, and recovery percentages keep their existing meaning.
This removes the function-argument ceiling; it does not cap, truncate, or claim constant-memory rendering of long histories.
Validation
Tested base:
1e357bf2d6632bfbd2a74ffb70ecee1af1ec7cc3.session-reportandcache-ledger-large-buckets.npm run typecheck,npm run build,npm run check:unused-exports,npm run check:test-import-graph, andgit diff --checkpass.Related history
All-author/all-state searches found no equivalent SVG-report fix. #6689 repaired the separate cache-ledger size-bucket minimum and is already in the tested base; this change covers the downstream SVG exporter. #6670 concerns history-array replacement in OpenCode/recovery hooks, and #7234 changes the browser save picker.