Skip to content

Conversation

@dylan-apex
Copy link

@dylan-apex dylan-apex commented Nov 10, 2025

Link to Issue or Description of Change

Problem:
Add support for display_name when creating and listing sessions to have a better user experience when viewing several sessions in a list to better tell which is which.

Solution:
Add display_name to BaseSessionService and update all the SessionServices that inherit to add support for this as well.

Testing Plan

Created new unit tests to cover adding a display_name and used existing tests to verify it was None
Tested the VertexAI Reasoning Engine locally

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

====================== 3139 passed, 2396 warnings in 42.29s =======================

Manual End-to-End (E2E) Tests:

image image

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

@gemini-code-assist
Copy link

Summary of Changes

Hello @dylan-apex, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the session management system by adding a display_name attribute to sessions. This allows users to provide a descriptive name when creating a session, which is then persisted and retrievable. The change improves the user experience by making it easier to distinguish between multiple sessions, especially when viewing them in a list. The implementation covers updates to the core session model, API endpoints, and all underlying session storage services, ensuring consistent behavior across the platform.

Highlights

  • Feature: Session Display Name: Introduced a new display_name field for sessions, allowing users to assign human-readable names to their sessions for better identification and management.
  • API and Model Updates: The Session model now includes an optional display_name field. The CreateSessionRequest in the web server API has been updated to accept this new field.
  • Service Layer Integration: The BaseSessionService and its concrete implementations (InMemorySessionService, DatabaseSessionService, SqliteSessionService, VertexAISessionService) have been modified to support the creation, storage, and retrieval of the display_name.
  • Database Schema Evolution: The SQLite and SQLAlchemy database schemas for sessions have been updated to include a display_name column, ensuring persistence of this new attribute.
  • Comprehensive Testing: New unit tests have been added to verify the correct storage and retrieval of display_name across different session service types, and existing tests were updated to confirm default None values.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@adk-bot adk-bot added the services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc label Nov 10, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully adds support for display_name when creating and listing sessions, which is a great enhancement for user experience. The changes are well-implemented across the different session service implementations (InMemory, Database, Sqlite). The addition of unit tests ensures the new functionality is working as expected and is properly persisted.

One area for improvement is in src/google/adk/sessions/vertex_ai_session_service.py. The create_session method signature should be updated to explicitly include the display_name parameter to match the base class BaseSessionService. Currently, it's being passed implicitly through **kwargs, which is less clear and breaks the interface contract defined by the abstract base class.

I've also left a specific comment regarding a potential bug in vertex_ai_session_service.py where a display_name with a falsy value (like an empty string) would be incorrectly converted to None.

dylan-apex and others added 3 commits November 10, 2025 15:42
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…adk-python into add-display-name-to-sessions
@dylan-apex
Copy link
Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for a display_name when creating and listing sessions, which improves user experience. The changes are well-implemented across various session services, including the base class, in-memory, database, and SQLite implementations. The necessary database schema updates and API request models are also included, along with corresponding unit tests.

My review has identified a couple of areas for improvement in VertexAiSessionService:

  1. The create_session method signature should be updated to align with the base class.
  2. There are some redundant or None checks that can be simplified for better code consistency and readability.

Overall, this is a solid feature addition. Addressing these points will improve the code's maintainability and adherence to design principles.

dylan-apex and others added 4 commits November 10, 2025 15:47
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…adk-python into add-display-name-to-sessions
@dylan-apex
Copy link
Author

@hangfei No one was assigned to this PR to review it - don't want it to get lost.

@dylan-apex dylan-apex changed the title feat(sessions): add display_name to create and list functions feat(sessions): add display_name to create, list, get functions Nov 11, 2025
@ryanaiagent ryanaiagent self-assigned this Nov 11, 2025
@dylan-apex
Copy link
Author

Fixed failing pytest - I think I forgot to merge this or something.
all tests pass locally
==================================================== 3152 passed, 2406 warnings in 50.74s ====================================================

@ryanaiagent
Copy link
Collaborator

Hi @dylan-apex ,Thank you for your contribution! We appreciate you taking the time to submit this pull request.
Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for display_name in sessions

3 participants