Interface AgentSessionOpener

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AgentSessionOpener
Strategy used by LocalSessionCache to lazily open an AgentSession.

Production wiring chooses one of two paths:

  • WebAgentSessionManagerBuilder.sessionFactory(...) — adapts AgentSessionFactory.open(ConversationId, String, AgentSessionOptions) into this opener; the empty default OpenAttributes flowing through the manager is ignored. This is the simple-case path used by aimon-cli and the example modules.
  • WebAgentSessionManagerBuilder.sessionOpener(...) — supplies a caller-defined opener directly so the implementation can read application-level attributes (e.g., tenant id, organization unit) from the OpenAttributes that the caller attached to the WebSubmitRequest.

Tests can supply a fake opener to substitute controllable AgentSession instances without standing up a real OrcaAgentExecutor.

Re-open semantics

The opener is invoked on cache miss only. While a session is cached on the holder node, subsequent submits with different OpenAttributes have no effect on the open session. See OpenAttributes for the full contract.

  • Method Summary

    Modifier and Type
    Method
    Description
    default at.aimon.core.agent.session.AgentSession
    open(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options)
    Convenience overload that delegates to open(ConversationId, String, AgentSessionOptions, OpenAttributes) with OpenAttributes.empty().
    at.aimon.core.agent.session.AgentSession
    open(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options, at.aimon.core.agent.session.OpenAttributes openAttributes)
    Opens a session bound to conversationId and agentRef, using openAttributes as the caller-provided attribute channel.
  • Method Details

    • open

      at.aimon.core.agent.session.AgentSession open(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options, at.aimon.core.agent.session.OpenAttributes openAttributes)
      Opens a session bound to conversationId and agentRef, using openAttributes as the caller-provided attribute channel.
      Parameters:
      conversationId - the conversation (must not be null)
      agentRef - the agent to bind on first open (must not be null)
      options - session options (must not be null)
      openAttributes - caller-provided attributes; OpenAttributes.empty() when the caller did not attach any (must not be null)
      Returns:
      the opened session (never null)
    • open

      default at.aimon.core.agent.session.AgentSession open(at.aimon.core.agent.conversation.ConversationId conversationId, String agentRef, at.aimon.core.agent.session.AgentSessionOptions options)
      Convenience overload that delegates to open(ConversationId, String, AgentSessionOptions, OpenAttributes) with OpenAttributes.empty().

      Provided so simple callers (and adapters from AgentSessionFactory) can ignore the attribute channel entirely.

      Parameters:
      conversationId - the conversation (must not be null)
      agentRef - the agent to bind on first open (must not be null)
      options - session options (must not be null)
      Returns:
      the opened session (never null)