perf(seer): Trim whitespace from ASCII snapshot to reduce token usage#110273
Merged
Mihir-Mavalankar merged 2 commits intomasterfrom Mar 10, 2026
Merged
perf(seer): Trim whitespace from ASCII snapshot to reduce token usage#110273Mihir-Mavalankar merged 2 commits intomasterfrom
Mihir-Mavalankar merged 2 commits intomasterfrom
Conversation
Contributor
Mihir-Mavalankar
commented
Mar 9, 2026
- The ASCII grid sent as on_page_context to Seer was emitting every row at full viewport width and preserving all blank rows, wasting lots of characters on spaces (depends on what page it's on). Blank spaces waste tokens (and therefore cost/latency) without carrying any information, reducing the useful context budget available for the LLM to reason about. These changes still preserve the structure of the page.
- Mitigating this by striping trailing spaces, removing the common leading indent from the nav-bar shift, and removing blank rows.
- Sample conversation with lots of blank space
The ASCII grid sent as on_page_context to Seer was emitting every row at full viewport width and preserving all blank rows, wasting ~80-90% of characters on spaces. Strip trailing spaces, remove the common leading indent from the nav-bar shift, and collapse consecutive blank rows into single blank lines. Co-Authored-By: Claude <noreply@anthropic.com>
Blank rows carry no useful information for the LLM. Remove them entirely rather than collapsing consecutive runs into single blanks. Co-Authored-By: Claude <noreply@anthropic.com>
aliu39
approved these changes
Mar 10, 2026
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.