session: CreateRequest missing DisplayName field (parity with Python ADK)
- Dominant language
- Go
- Stars
- 8.8k
- Forks
- 1k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 88
Description
### 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
```go
// 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
}
```
```go
// 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](https://github.com/google/adk-python/blob/main/src/google/adk/sessions/vertex_ai_session_service.py#L95-L103)):
```python
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`.
Contributor guide
Research direction
Start with session/service.go to inspect CreateRequest, then follow createSession in session/vertexai/vertexai_client.go to see how the Vertex AI protobuf Session is built. Add coverage for the optional field and verify that the value reaches Vertex AI while other backends remain unaffected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100