Skip to content

perf(seer): Trim whitespace from ASCII snapshot to reduce token usage#110273

Merged
Mihir-Mavalankar merged 2 commits intomasterfrom
perf/trim-ascii-snapshot-whitespace
Mar 10, 2026
Merged

perf(seer): Trim whitespace from ASCII snapshot to reduce token usage#110273
Mihir-Mavalankar merged 2 commits intomasterfrom
perf/trim-ascii-snapshot-whitespace

Conversation

@Mihir-Mavalankar
Copy link
Contributor

  • 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

Mihir-Mavalankar and others added 2 commits March 9, 2026 15:58
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>
@Mihir-Mavalankar Mihir-Mavalankar self-assigned this Mar 9, 2026
@Mihir-Mavalankar Mihir-Mavalankar requested a review from a team as a code owner March 9, 2026 23:14
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 9, 2026
@Mihir-Mavalankar Mihir-Mavalankar merged commit 0b28263 into master Mar 10, 2026
61 checks passed
@Mihir-Mavalankar Mihir-Mavalankar deleted the perf/trim-ascii-snapshot-whitespace branch March 10, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants