agent.run() path — no manual session plumbing.
You’ll end up with. Two final messages (turn 1 and turn 2) printed to stdout, with the second turn resumed from the same session_id.
Shows the convenience path for ask-once-and-wait conversational flows.
agent.run() dispatches on agent type: functional agents stay sync,
conversational agents return a coroutine that creates a hidden session,
sends one turn, waits for the final message, and cleans up.
For streaming, approvals, or multi-turn context, keep using
agent.create_session() explicitly.
Expected output
keep_alive=True on turn 1 is what lets turn 2 resume the same session_id — without it the hidden session would have terminated on exit.
See also
Agent CRUD
Full agent lifecycle — create, fetch, update, delete.
Single-turn session
Drop the convenience wrapper and stream a turn yourself.
Agent reference
Full method surface.
