Repository navigation
Google ADK memory callbacks retain session protection - #898
Merged
Merged
Conversation
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
zlareb1
marked this pull request as ready for review
November 18, 2026 18:40
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.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Google ADK memory callbacks retain the session protection of the conversations that contribute to them.
Why
The memory service can outlive its transport binding or observation context. Automatic recall and extraction retain constructor and earlier callback contributors when later callbacks run under another binding.
Scope and risk
The service uses the shared callback protection helper before reading native inputs. Content methods apply retained automatic controls only when the caller already has automatic context; directly invoked operations remain explicit and observe responses through the retained families. Exact-reference deletion retains observers without becoming automatic content capture.
All SDK send expressions, payload options, identities, batch sizes and native return contracts remain unchanged. A marked memory recall that suppresses the optional knowledge request raises instead of returning a fabricated memory response. Batch interruption raises without acknowledging unsent events or modifying native history. Native app, user and session identifiers do not establish protection authority.
The framework guide documents these boundaries. The sender census renews only the existing reviewed source hash; its exact-reference exception and operation classifications remain unchanged. The complete regression module is byte-identical to the hosted failing baseline.
Compatibility, rollout and rollback
Tests
Hosted native baseline: ADK 2.14.1 on Python 3.12 reports 14 failures and 60 passes in 2.54 seconds; ADK 2.14.0 on Python 3.11 reports the same 14 failures and 60 passes in 3.50 seconds. Every failure matches the retained-control diagnosis; all original cases and explicit, reference and clean native controls pass.
Changed-file Ruff lint, formatting, whitespace and scoped strict mypy checks pass. Static comparisons confirm all five SDK send call ASTs and the exact-reference census key are unchanged. The complete test module remains byte-identical to the hosted baseline.
No local native tests, collection, application imports or dependency installation ran. The corrected head passes all 74 native cases on both supported legs: ADK 2.14.1 on Python 3.12 in 3.51 seconds and ADK 2.14.0 on Python 3.11 in 2.99 seconds. Both strict native type checks pass. Fresh independent whole-change source review reports no findings or nits. All 45 check results are terminal: 43 succeed and two publication checks are skipped. All four applicable workflows and all 42 runnable jobs succeed. Merge remains subject to repository branch rules.
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: An agent wrote the change. Independent whole-change source review and both hosted native resolutions pass; all required CI checks pass.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist