Repository navigation
docs: Demonstration of Google Firestore for Persistent session data … - #2818
mohan-ganesh wants to merge 9 commits into
Conversation
d2891b1 to
bc61289
Compare
|
Ready for review. All checks pass. Re-requested review from |
bc61289 to
e870529
Compare
…r Persistent session data store
b189f71 to
12893ca
Compare
happyhuman
left a comment
There was a problem hiding this comment.
Just reviewed the PR and left a few comments. PTAL
| language: "java" # Options: [python | java | go | kotlin | typescript] | ||
| description: "Demonstrates persistent multi-turn conversation using Google Firestore as a session data store with the ADK Java SDK." | ||
|
|
||
| deployable: true |
There was a problem hiding this comment.
The .github/policy.yml entry in this PR notes FirestoreRunner is an interactive stdin CLI rather than a service. Should deployable be false here?
There was a problem hiding this comment.
This issue was flagged from my prior run..
Looking at tools/validate_manifest.py — every recipe under contrib/ is required to have deployable: true unconditionally, so it needs to stay. The .github/policy.yml exemption I added is answering a different question: it only skips the recipe-docker-build HTTP-probe step for this recipe, since FirestoreRunner is a stdin CLI and never binds a port — the image still gets built. Added a comment on the deployable: true line in the manifest clarifying this so it doesn't look contradictory again.
4c2b737 to
7a4f290
Compare
|
thanks for review Shahin @happyhuman. I have addressed all except the manifest.yml.. that seem to have dependancy on the contrib/ is required to have deployable: true unconditionally.. please take a look. |
happyhuman
left a comment
There was a problem hiding this comment.
Just reviewed the PR and left a few comments. PTAL
| .toMaybe() | ||
| : Maybe.error(error)) | ||
| .blockingGet(); | ||
| logger.info("Resumed session " + sessionId + " for user " + userId); |
There was a problem hiding this comment.
It seems this still logs "Resumed session" when the SessionNotFoundException fallback above created a brand-new session instead. Is that intentional?
There was a problem hiding this comment.
This was intentional. If the user passes an user id and session id, if found use, else create the session using the provided values for demonstration.
| logger.info("FirestoreRunner finished execution."); | ||
| // The Gemini API client leaves non-daemon OkHttp threads running; force | ||
| // a clean exit instead of waiting on them to time out. | ||
| System.exit(0); |
There was a problem hiding this comment.
still exits 0 after the catch above
There was a problem hiding this comment.
The System.exit(0) isn't there to handle the exception from the catch block above — it's there regardless of whether an exception occurs. The catch only logs errors from the chat loop; it doesn't change the JVM's thread state.
The real issue is that the Gemini API client (via OkHttp) spins up non-daemon threads internally. Those threads keep running even after main() returns normally, which means the JVM won't exit on its own — the process just hangs. System.exit(0) forces termination so the process doesn't get stuck waiting on threads we don't manage.
So this isn't error-path cleanup; it's unconditional shutdown needed because of a dependency's threading behavior, placed after the try-catch so it runs whether we exit via quit, EOF, or a caught exception.
|
@happyhuman updated the comments to two new query. |
happyhuman
left a comment
There was a problem hiding this comment.
Just reviewed the PR and left a few comments. PTAL
- Comment out GOOGLE_API_KEY in .env.example for default Vertex AI path - Document env export step in README for Java runtime - Preserve stack trace on error in FirestoreRunner - Remove redundant resources COPY in Dockerfile - Add Apache-2.0 license header to logback.xml
|
@happyhuman addressed the latest review comments.. please review them. |
…el to gemini-3.7-flash, and add docker docs - Update default model from gemini-3.5-flash to gemini-3.7-flash - Add .dockerignore to exclude target, .env, and metadata from build context - Add Apache-2.0 license header to adk-firestore.properties - Document interactive Docker CLI usage in README
docs: Demonstration of Google Firestore for Persistent session data
Add agent demonstrating session persistence using Google Cloud Firestore
This commit introduces a new sample agent, FirestoreRunner, that shows how to use FirestoreDatabaseRunner to persist agent session state. It includes a simple time-telling agent and a corresponding test class
Submitting new PR @happyhuman as per #772