docs(runtime): clarify filtered session history retention - #2244
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Technical review report
- Review Score: 100
- Overall assessment: 🟢 Low Risk
- Summary reasoning: The three added sentences in
docs/runtime/runconfig.mdstate thatGetSessionConfigfilters (num_recent_events,after_timestamp) only narrow the loaded view and that new events append to the full stored history. I verified this against every session service shipped in the current release, adk-python v2.9.1, and the claim is correct in each. The API referenced is released, not merged-but-unreleased. - Recommended action: No concerns, approve. The change adds accurate clarification to an already-correct bullet, touches no code samples, and introduces no new API surface. The only observation is stylistic (mild redundancy between the two new sentences), not a technical risk.
- Number of lines changed: XS, 4
- Number of files changed: 1
Verification detail
The changed text is at docs/runtime/runconfig.md:76-80, inside a section tagged "Supported in ADK: Python", which matches the fact that get_session_config exists only on Python's RunConfig: run_config.py:262-280.
Claim 1 — "These filters limit the loaded view without deleting stored events":
InMemorySessionServiceslices a copy of the session (_copy_session, thencopied_session.events = copied_session.events[-num_recent_events:]); the stored session object is untouched: in_memory_session_service.py:202-217.DatabaseSessionServiceapplies the filters as aWHERE timestamp >= .../LIMITon the read query only: database_session_service.py:706-734.SqliteSessionServicelikewise, as SQLAND timestamp >= ?/LIMIT ?: sqlite_session_service.py:309-326.VertexAiSessionServicepassesafter_timestampas a server-side list filter and trimsnum_recent_eventsclient-side on the returned list: vertex_ai_session_service.py:240-300.
Claim 2 — "New events are appended to the stored history, preserving older events excluded from the loaded view":
- In-memory:
append_eventappends to the canonicalstorage_session, even when the caller holds a filtered copy: in_memory_session_service.py:354. - Database:
append_eventinserts a newStorageEventrow and never rewrites the event table: database_session_service.py:976. - The Runner passes
run_config.get_session_configstraight intosession_service.get_session()on the load path, so filtering is confined to the read: runners.py:895-900.
No risk items found. One optional, non-scoring wording note: "without deleting stored events" and "preserving older events excluded from the loaded view" say the same thing twice; the bullet could be tightened to a single sentence, e.g. These filters limit the loaded view only: stored events are not deleted, and new events are appended to the full stored history.
joefernandez
left a comment
There was a problem hiding this comment.
Thanks for the update!
Co-authored-by: Joe Fernandez <931947+joefernandez@users.noreply.github.com>
Clarifies that Python
RunConfig.get_session_configlimits the loaded event view while preserving stored history when new events are appended. This accompanies the Redis filtered-history preservation fix ingoogle/adk-python.Testing
mkdocs build --strictpasses and indexes 235 pages. It reports an existing missing migration-page anchor at INFO level; this change adds no links.mkdocs servereturns HTTP 200 and renders the clarification as part of the existing list item.