Documentation
¶
Index ¶
- func NewService(dbURL string) (adksession.Service, error)
- type LocalSessionService
- func (s *LocalSessionService) Create(ctx context.Context, request *adksession.CreateRequest) (*adksession.CreateResponse, error)
- func (s *LocalSessionService) Delete(ctx context.Context, request *adksession.DeleteRequest) error
- func (s *LocalSessionService) Get(ctx context.Context, request *adksession.GetRequest) (*adksession.GetResponse, error)
- func (s *LocalSessionService) List(ctx context.Context, request *adksession.ListRequest) (*adksession.ListResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(dbURL string) (adksession.Service, error)
NewService builds the actor-local session service selected by AgentConfig.session_db_url. A missing URL leaves session selection to the caller, which typically uses in-memory state.
Types ¶
type LocalSessionService ¶
type LocalSessionService struct {
// AppendEvent already receives a native Session from Create/Get, so it can
// use the upstream implementation without another identity rewrite.
adksession.Service
}
LocalSessionService stores one Actor's native ADK conversation in SQLite on its durableDir volume (AgentConfig.session_db_url). The private database provides isolation, so different Actors can safely use the same local conversation key. This service must not be used to multiplex independent conversations in one DB.
The ADK A2A executor selects state by app name, caller user ID, and context ID. Here, a fork gets a new public context ID but copies the native database, and a shared Session can be invoked by a different user. Neither change should select an empty native conversation. We therefore keep the configured app name and normalize both user and session lookup keys to the fixed local key below. Forks continue the copied history and write only to their own database.
Shared in-process subagents participate in this same native conversation. A child with an independent conversation needs its own store or distinct keys; remote A2A child context/task IDs are separate and are not rewritten here.
Returned ADK sessions expose these private keys. Routing, lineage, and external correlation must use the public A2A context ID carried by the executor instead. Authorization and user memory must use the actual caller, never the local user key. Normalizing storage keys does not grant access to a public Session.
func NewLocalSessionService ¶
func NewLocalSessionService(dbURL string) (*LocalSessionService, error)
NewLocalSessionService opens (creating if needed) the sqlite DB named by dbURL (e.g. "sqlite:////data/sessions.db") and migrates the upstream ADK schema.
func (*LocalSessionService) Create ¶
func (s *LocalSessionService) Create(ctx context.Context, request *adksession.CreateRequest) (*adksession.CreateResponse, error)
func (*LocalSessionService) Delete ¶
func (s *LocalSessionService) Delete(ctx context.Context, request *adksession.DeleteRequest) error
func (*LocalSessionService) Get ¶
func (s *LocalSessionService) Get(ctx context.Context, request *adksession.GetRequest) (*adksession.GetResponse, error)
func (*LocalSessionService) List ¶
func (s *LocalSessionService) List(ctx context.Context, request *adksession.ListRequest) (*adksession.ListResponse, error)