π Prerequisites
π Bug summary
Running the Go ADK agent (go/adk) without KAGENT_URL β i.e. standalone / BYO mode with in-memory sessions β fails on every message/send with session <id> not found, before any LLM call. The agent never produces a response.
Root cause
When KAGENT_URL is unset, the runner is configured with an in-memory ADK session service:
// go/adk/pkg/runner/adapter.go
var adkSessionService adksession.Service
if sessionService != nil {
adkSessionService = sessionService
} else {
adkSessionService = adksession.InMemoryService() // <- nobody creates sessions in this
}
But the A2A executor only creates the session when the kagent session service is wired:
// go/adk/pkg/a2a/executor.go β Execute()
if e.sessionService != nil {
// ... GetSession / CreateSession ...
}
// (no else branch β in standalone mode the session is never created)
So runner.Run(ctx, userID, sessionID, ...) looks up a session that was never created and returns session <id> not found. The task ends in state failed.
Reproduction
- Build the agent and run it with a minimal
config.json (any provider) and no KAGENT_URL:
CONFIG_DIR=./cfg PORT=8080 GOOGLE_CLOUD_PROJECT=... GOOGLE_CLOUD_LOCATION=us-central1 GOOGLE_GENAI_USE_VERTEXAI=1 ./agent
# log: "No KAGENT_URL set, using in-memory session and no task persistence"
- Send an A2A message:
curl -sX POST -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":"1","method":"message/send","params":{"message":{"role":"user","parts":[{"kind":"text","text":"hi"}],"messageId":"m1"}}}' \
http://localhost:8080/
- The task returns
"state":"failed" with "session <contextId> not found".
Suggested fix
In Execute, when e.sessionService == nil, create the session in the runner's session service before running, e.g.:
} else if e.runnerConfig.SessionService != nil {
_, _ = e.runnerConfig.SessionService.Create(ctx, &adksession.CreateRequest{
AppName: e.appName, UserID: userID, SessionID: sessionID,
})
}
(Verified locally: with this, standalone mode completes the LLM call and returns a response.)
π― Affected Service(s)
App Service (go/adk agent runtime)
π Prerequisites
π Bug summary
Running the Go ADK agent (
go/adk) withoutKAGENT_URLβ i.e. standalone / BYO mode with in-memory sessions β fails on everymessage/sendwithsession <id> not found, before any LLM call. The agent never produces a response.Root cause
When
KAGENT_URLis unset, the runner is configured with an in-memory ADK session service:But the A2A executor only creates the session when the kagent session service is wired:
So
runner.Run(ctx, userID, sessionID, ...)looks up a session that was never created and returnssession <id> not found. The task ends in statefailed.Reproduction
config.json(any provider) and noKAGENT_URL:"state":"failed"with"session <contextId> not found".Suggested fix
In
Execute, whene.sessionService == nil, create the session in the runner's session service before running, e.g.:(Verified locally: with this, standalone mode completes the LLM call and returns a response.)
π― Affected Service(s)
App Service (go/adk agent runtime)