Repository navigation
fix(sessions): skip partial events in VertexAiSessionService and FirestoreSessionService - #1994
Open
chjpooh2002 wants to merge 1 commit into
Open
chjpooh2002 wants to merge 1 commit into
chjpooh2002 wants to merge 1 commit into
Conversation
…storeSessionService
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
1. Link to an existing issue (if applicable):
2. Summary of Change:
VertexAiSessionService.appendEventnorFirestoreSessionService.appendEventreturned early for partial events (event.partial().orElse(false)).VertexAiSessionServicestill chained.flatMap(...)intoclient.appendEvent(...)afterBaseSessionService.super.appendEventreturned early, andFirestoreSessionServicenever checkedevent.partial(), mutating session state/timestamp and persisting partial events to Firestore.Single.just(event)(oreventinsideSingle.fromCallable) immediately after argument validation whenevent.partial().orElse(false)istrue, matchingBaseSessionService.appendEvent(BaseSessionService.java:217-235) andadk-python.Testing Plan
Unit Tests:
Added unit tests:
VertexAiSessionServiceTest#appendEvent_partialEvent_doesNotCallBackendOrMutateSessionmockApiClient.request(...)was invoked withPOST reasoningEngines/123/sessions/1:appendEventcarrying"partial":true).Tests run: 42, Failures: 0, Errors: 0, Skipped: 0.FirestoreSessionServiceTest#appendEvent_partialEvent_doesNotMutateStateOrPersistToFirestorestateDeltato Firestore viaDocumentReference.update).Tests run: 42, Failures: 0, Errors: 0, Skipped: 0.Command run:
Result:
BUILD SUCCESS(all 42 + 42 tests passed).Manual End-to-End (E2E) Tests:
N/A (mock-backed unit tests cover both backend persistence skipping and local session immutability).
Checklist
Additional context
Thanks to @sahuadarsh0 for pointing out these two implementations in #1990!