feat(models): add get_update_marker() for google-adk 1.28.0 compatibility#154
Merged
Conversation
…lity google-adk 1.28.0 introduces get_update_marker() on StorageSession for string-based optimistic concurrency, replacing float timestamp comparison. Without this method, EncryptedStorageSession raises AttributeError when append_event() is called under 1.28.0. - Add get_update_marker() returning ISO 8601 with microsecond precision - Add update_timestamp_tz property (pre-existing parity gap with upstream) - Update to_session() to stamp _storage_update_marker on returned Session - Add sentinel test verifying duck-type parity with ADK StorageSession - Add unit tests for marker format, UTC normalization, and round-trip
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds forward-compatibility with google-adk 1.28.0’s string-based optimistic concurrency by implementing get_update_marker()/update_timestamp_tz parity on the encrypted StorageSession model and ensuring returned Session objects are stamped with _storage_update_marker.
Changes:
- Add
EncryptedStorageSession.get_update_marker()andupdate_timestamp_tzfor ADK StorageSession parity. - Update
to_session()to stamp_storage_update_markeron the returned ADKSession. - Add unit + integration sentinel tests to validate marker behavior and duck-typed parity with ADK’s
StorageSession.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/adk_secure_sessions/services/models.py |
Implements get_update_marker(), adds update_timestamp_tz, and stamps _storage_update_marker in to_session() for optimistic concurrency compatibility. |
tests/unit/test_models.py |
Adds unit tests for marker formatting/UTC normalization, update_timestamp_tz, and _storage_update_marker stamping. |
tests/integration/test_adk_conformance.py |
Adds a sentinel parity test against upstream StorageSession and round-trip assertions that _storage_update_marker is populated. |
_bmad-output/implementation-artifacts/tech-spec-adk-128-get-update-marker.md |
Documents the implementation plan and acceptance criteria for the ADK 1.28.0 compatibility work. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
google-adk 1.28.0 introduces
get_update_marker()onStorageSessionfor string-based optimistic concurrency, replacing float timestamp comparison. Without this method,EncryptedStorageSessionraisesAttributeErrorwhenappend_event()is called under 1.28.0.get_update_marker()returning ISO 8601 with microsecond precisionupdate_timestamp_tzproperty (closes pre-existing parity gap with upstream)to_session()to stamp_storage_update_markeron returnedSessionStorageSessionTest:
uv run pytest tests/unit/test_models.py tests/integration/test_adk_conformance.py -vPR Review
Checklist
uv run pytest)uv run ruff check .)!in title andBREAKING CHANGE:in bodyReview Focus
update_timestamp_tzhardcodesis_sqlite=False(diverges from upstream's dynamic detection viainspect(self).session). Documented in aNote:block. Revisit after 1.28.0 upgrade._storage_update_markeris set via direct assignment onSession(valid Pydantic v2 underscore attr). In 1.28.0 it becomes a properPrivateAttr(default=None).Related