[Suggestion] Update documentation for the session interface to clarify how it internally works
@kdroste-google is already working on this.
Since May 19, 2026.
- Dominant language
- Go
- Stars
- 8.8k
- Forks
- 1k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 88
Description
🔴 Required Information
Is your feature request related to a specific problem?
While implementing a custom session.Session, it was confusing that my events weren't taken into account by the agent.
ie
Prompt : "Reply to general questions"
If my GetResponse is
return &session.CreateResponse{
Session: sessionImplementation,
}, nil
The response to "What is the capital city of Germany" will be "Hello, I am ready to help!"
While what is expected is "The capital city of Germany is Berlin." which happens only when a reference is passed :
return &session.CreateResponse{
Session: &sessionImplementation,
}, nil
This happens because :
- Session is saved at https://github.com/google/adk-go/blob/03705a53d99ea9b2e794ef5328f8f70cb2c90e43/runner/runner.go#L130
- Events reference is updated at https://github.com/google/adk-go/blob/main/runner/runner.go#L172
Proposed Solution
-
Update documentation in https://github.com/google/adk-go/blob/v0.4.0/session/service.go#L72-L75 indicating that a reference to the session object is expected.
-
(Potentially), do the same in AppendEvent indicating that the session argument should be modified directly through the request.
I
Impact on your work
This is confusing when trying to implement a custom session, as it often means that the only way to know how it works internally is to check the source code directly/ the inmemory implementation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.