Skip to content

[PR] fix(render): avoid argument limits when locating large fold anchors - #6246

Closed
Afloat16 wants to merge 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-11_plugin-render-large-fold
Closed

Afloat16 wants to merge 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-11_plugin-render-large-fold

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Fixes #6231

Problem

Math.max(...blockSeqs) passes one argument per covered message. A valid 150,000-message fold exceeds the engine's argument limit and makes the plugin render endpoint return 502, despite accepting history windows up to 1,000,000 entries.

Change

Track the maximum covered sequence while populating coverage. This removes the argument-count limit and the temporary per-block sequence array. Existing summary anchor positions, uncovered rows and unresolved-block handling retain their behavior.

Validation

  • Unchanged master: the 150,000-message local HTTP regression returns 502 with RangeError.
  • Updated endpoint returns 200 with one fold anchor and the uncovered tail. The case includes reverse-ordered IDs, sparse sequence numbers, an unresolved ID, and a block with no matching rows.
  • Storage rows are injected; this is not a database throughput or live upstream model test.
  • 9 targeted endpoint/anchor tests passed. npm run typecheck, npm run build, npm run check:test-import-graph and git diff --check passed on this independent branch.
  • Zero-token Codex preflight passed; its upstream probe was unreachable and the real-model E2E remains gated/skipped.
  • Full-suite verdict remains with repository CI.

@ranxianglei

Copy link
Copy Markdown
Owner

Landed via batch PR #6439 (merged) — closing as superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][render] Large folded histories exceed Math.max argument limits and return 502

2 participants