8000 fix(sessions): filter events independently of timestamp order by moneymaker26754-crypto · Pull Request #1203 · google/adk-js · GitHub
[go: up one dir, main page]

Skip to content

fix(sessions): filter events independently of timestamp order - #1203

Draft
moneymaker26754-crypto wants to merge 1 commit into
google:mainfrom
moneymaker26754-crypto:moneymaker26754/fix-session-timestamp-filter
Draft

moneymaker26754-crypto wants to merge 1 commit into
google:mainfrom
moneymaker26754-crypto:moneymaker26754/fix-session-timestamp-filter

Conversation

@moneymaker26754-crypto
Copy link
Copy Markdown
Contributor

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

  • All three regressions fail against unchanged main; the patched session test file passes all 51 tests.
  • Build, source/sample type checks, repository lint/format/docs checks, changed-file secretlint and git diff --check pass.
  • Full core unit suite: 5644 passed, 4 skipped, 2 failed. The same two fail on unchanged main (5641 passed): file_utils cannot create a Windows symlink (EPERM), and logs_test cannot find its .latest.log symlink (ENOENT). The core suite is not green.
  • Full repository coverage runs (original thresholds retained):
    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.

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.

1 participant

0