Skip to content

perf(runtime): make context pruning size-aware - #112

Merged
yashranaway merged 1 commit into
mainfrom
t3code/prune-budget-quality
Aug 10, 2026
Merged

perf(runtime): make context pruning size-aware#112
yashranaway merged 1 commit into
mainfrom
t3code/prune-budget-quality

Conversation

@yashranaway

Copy link
Copy Markdown
Collaborator

Closes #25

Summary

  • measure each result and candidate once instead of repeatedly serializing the full response
  • prune the largest entries regardless of position while retaining stable order
  • byte-budget text fallback with a bounded prefix search
  • report exact finalized byte/token statistics and preserve fail-closed bounds
  • add jsdom regressions for mid-array pruning, serialization count, and text fallback
  • mark backlog B5 complete

Validation

  • npx --yes pnpm@9.15.0 test:runtime
  • npx --yes pnpm@9.15.0 test:e2e:linux (includes 43/43 protocol tests)

@yashranaway
yashranaway merged commit af81244 into main Aug 10, 2026
13 of 14 checks passed
@yashranaway
yashranaway deleted the t3code/prune-budget-quality branch August 10, 2026 20:34
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.

B5 — pruneToBudget quality

1 participant