Skip to content

perf(langgraph): index exact IDs in history snapshots - #1431

Merged
blove merged 5 commits into
mainfrom
blove/chat-long-history-rendering
Nov 2, 2026
Merged

blove merged 5 commits into
mainfrom
blove/chat-long-history-rendering

Conversation

@blove

@blove blove commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

A completed response can send a full 10,001-message values snapshot through reconciliation. Exact-ID matching previously restarted a linear transcript search for every incoming row, requiring 50,015,001 predicate visits in the matching ordered case. Use an ephemeral first-index map for multirow snapshots, preserving the first duplicate match and updating actual IDs after appends or fallback assignments. Single-row/delta lookup and content/cross-ID fallbacks retain their existing behavior.

Also skip unchanged classifier text within its existing generation lifecycle. A real-template regression reduces 500 redundant historical classifier pushes to zero while preserving in-place changes, generation reset, and failed-update retry. The batch regression exercises actual restore → stream → full values synchronization, bounds predicate visits to one transcript scan, and verifies complete ordered content, identity, and terminal delivery. Edge controls cover duplicates, reordered/repeated/appended IDs, falsy IDs, aliases, stale snapshots and canonical restrictions.

Validation on Node 24.20.0:

  • 1,353 chat tests and 526 LangGraph tests passed.
  • 1,021 runtime tests, LangGraph type/runtime-type contracts, both changed-project lints, and five production package builds passed. Lint has warnings and zero errors.
  • Migration inventory and source boundaries passed; inventory/boundary controls passed 580 tests. Existing ownership and gates remain intact.
  • Independent correctness and quality review completed.

Fresh package-based native comparison completed: 24/24 functional cases and complete traces passed (12 control, 12 candidate), with all 12 exact fixture pairs retained and independently audited. Across the three 10,000-message rounds, observed maximum renderer task intervals were 219–244 ms → 169–192 ms for follow mode and 232–262 ms → 158–203 ms for history-reading. Many ≥50 ms tasks remain (74–86 across arms); layout/GC results are mixed. These are whole-capture wall intervals on one machine, control arm first, not function-attributed timings or complete task-population coverage. Both arms are local builds; neither is labeled registry stock. This optimizes exact-ID lookup for matching batches; content fallback can still scan. No CPU-time, FPS or general performance-ranking claim is made. Raw traces remain local and historical stock/candidate results stay separate.

Postmerge verification at 6643790a: full CI including production smoke passed. A separate reverse-order native replication passed all 24 cases with complete traces; independent raw recomputation matched all reported counts and witnesses. At H10000, maximum observed task ranges were 209–237 ms control versus 175–181 ms merged for follow, and 227–234 ms versus 166–173 ms for history reading. Long-task counts, layout and GC were mixed; all twelve pairs remain in local evidence. These are local package builds and whole-capture wall intervals, with one-machine/order limitations, not published-stock, CPU-time, function-attributed or FPS measurements. A subsequent main commit changes only unrelated documentation and has its own CI run.

@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Nov 2, 2026 4:46am UTC

Request Review

@blove blove changed the title perf(chat): avoid redundant work for unchanged message history perf(langgraph): index exact IDs in history snapshots Nov 2, 2026
@blove
blove marked this pull request as ready for review November 2, 2026 05:35
@blove
blove enabled auto-merge (squash) November 2, 2026 05:36
@blove
blove merged commit 6643790 into main Nov 2, 2026
132 checks passed
@blove
blove deleted the blove/chat-long-history-rendering branch November 2, 2026 05:55

This branch was successfully deployed

1 active deployment
Preview – threadplane — b7fa9dda Deployed Nov 2, 2026 by vercel[bot]
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.

1 participant