Session(session_id=...) tries (and fails) to resume it.
You’ll end up with. A printed first delta, a “Terminating session immediately!” log, and a failed resume attempt confirming the session is dead.
Demonstrates creating a session, sending a message, and terminating
the session as soon as the first streaming delta arrives.
After termination, the session should not be resumable.
Expected output
terminate() differs from disconnect() in that the session id is gone for good — the second Session(session_id=...).connect() is expected to error out, which is the success signal here.
See also
Resume a session
The opposite move — resume instead of terminate.
Chatbot session
Same
Session API, but bound to a Chatbot instead of an Agent.Session reference
connect, terminate, and is_connected in detail.