yr.SessionService.load_session

yr.SessionService.load_session#

SessionService.load_session() ManagedSessionObj | None[source]#

Load Session object for current invocation.

  • Uses Context.sessionId to call native LoadCurrentSession(sessionId)

  • libruntime reads currently active AgentSessionContext from activeSessionMap[sessionId]

  • Returns language wrapper of in-memory Session object

Note

  • Returns None when current request does not carry sessionId

  • Returns None when use_agent_session=false

  • When use_agent_session=true and session is not created, runtime automatically creates empty SessionObj and writes to DataSystem, load_session() still returns object (with empty content)

Returns:

ManagedSessionObj, or None when sessionId is empty

Raises:

RuntimeError – raised when bridge call fails