Repository navigation
fix(sessions): filter events independently of timestamp order - #1203
Draft
moneymaker26754-crypto wants to merge 1 commit into
Draft
moneymaker26754-crypto wants to merge 1 commit into
moneymaker26754-crypto wants to merge 1 commit into
Conversation
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.
Link to Issue or Description of Change
New locally reproduced bug: InMemorySessionService.getSession scans backwards and slices after the first old event, assuming monotonic timestamps. Appending timestamps 3000, 1000, 4000 and requesting afterTimestamp=2000 returns only 4000, dropping the matching 3000 event. A cutoff of zero is also treated as absent.
Filter individual events with an explicit undefined check. Preserve inclusive boundaries, insertion order, the existing order of the two filters, and the stored session. Add three regressions. The existing timestamp-zero fixture now sets zero after createEvent so it does not depend on the separate factory bug tracked by PR #1018.
Testing Plan
adk-js-base-coverage: 124; Stopped after 240 seconds; suite and coverage incomplete, no final coverage percentage.
adk-timestamp-coverage: 124; Stopped after 240 seconds; suite and coverage incomplete, no final coverage percentage.
These results do not constitute a green full suite or completed upstream CI.
Additional context
Based on main 22a244e, Node 24.22.1 on Windows. Uses only local sessions and test data; no live model API is required.
PR #1102 adds related timestamp-boundary tests, but does not change this implementation. This patch is limited to the in-memory service and does not change numRecentEvents=0 semantics.
AI-assisted initial draft. Human refinement is pending; proposed as a draft PR for review.