GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add tests for LastMaxTokenSizeContentPurger by jhl221123 · Pull Request #3293 · spring-projects/spring-ai

Conversation

@jhl221123

@jhl221123 jhl221123 commented May 22, 2025

Copy link
Copy Markdown

Hi team,

This PR introduces unit tests for LastMaxTokenSizeContentPurger, following up on the discussion in issue #2894.

While working on the tests, I encountered a particular scenario regarding the totalSize parameter that I'd like to clarify. It seems that if totalSize is passed in with a value smaller than the actual sum of estimateTokenCount for the List<MediaContent> datum, the current logic might not perform the expected purging.

For example, if datum contains items with token counts (total 120), and purgeExcess() is called with totalSize (100) and maxTokenSize (100), the initial while loop condition (totalSize > this.maxTokenSize) would be false. Consequently, no items from datum would be purged, potentially leading to the final token count exceeding maxTokenSize.

Is this behavior intended, or is there something I might be overlooking regarding how totalSize is expected to be calculated and passed to this method?

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jhl221123
Add tests for LastMaxTokenSizeContentPurger
de82f81
Signed-off-by: Junhyeok Lee <[email protected]>
@markpollack markpollack assigned tzolov May 29, 2025
@markpollack markpollack added the status: waiting-for-feedback label May 29, 2025
@markpollack markpollack added testing advisors and removed status: waiting-for-feedback labels Sep 28, 2025
@jhl221123 jhl221123 mentioned this pull request Dec 28, 2025
📢오픈소스 기여모임 - 운영진 소개 opensource-contributors-group/opensource-contributors#2
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@tzolov tzolov

Labels

advisors testing

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jhl221123 @markpollack @tzolov
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.