Skip to content

session: CreateRequest missing DisplayName field (parity with Python ADK) #706

@rubda

Description

@rubda

Is your feature request related to a specific problem?

The Python ADK's VertexAiSessionService.create_session accepts **kwargs that are forwarded to the Vertex AI API, allowing callers to set display_name on session creation. The Go ADK's session.CreateRequest struct has no equivalent field, so there is no way to set a human-readable name for sessions at creation time.

This forces workarounds like storing names in session state or making separate UpdateSession API calls after creation.

Proposed Solution

Add a DisplayName string field to session.CreateRequest and pass it through to the Vertex AI protobuf Session.DisplayName in vertexai_client.go.

The field is optional and zero-valued by default, so it is fully backward compatible. Non-Vertex AI backends (in-memory, database) can safely ignore it.

Impact on your work

We use ADK sessions for a chat assistant and need user-facing session names derived from the first message. Without DisplayName support, we store names in session state and read them back in our application layer — unnecessary complexity for what should be a simple field passthrough.


Alternatives Considered

  1. Store name in session state: Works, but the name lives in app-level state rather than the native DisplayName field. Requires custom toSession logic to extract it.
  2. Call UpdateSession after creation: Adds an extra API round-trip per session creation for a field that could be set at creation time.

Willingness to contribute

Yes — I have a branch with the implementation and tests ready to submit as a PR.

Proposed API / Implementation

// session/service.go
type CreateRequest struct {
    AppName     string
    UserID      string
    SessionID   string
    State       map[string]any
    // DisplayName is a human-readable name for the session.
    // Optional: only used by backends that support it (e.g. Vertex AI).
    DisplayName string
}
// session/vertexai/vertexai_client.go — createSession
pbSession := &aiplatformpb.Session{
    UserId:      req.UserID,
    DisplayName: req.DisplayName, // new
}

Additional Context

The Python ADK supports this via **kwargs passthrough (source):

async def create_session(self, *, app_name, user_id, state=None, session_id=None, **kwargs):
    # kwargs like display_name are forwarded to the Vertex AI API

The underlying Vertex AI protobuf Session message already has DisplayName — the Go ADK just doesn't expose it through CreateRequest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions