session

package
v0.0.0-...-eae0450 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 (*LocalSessionService) Delete

func (*LocalSessionService) Get

func (*LocalSessionService) List

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL