Member Junction
    Preparing search index...
    • Walks conversation history from newest to oldest to find the most recent non-manager AI message that owns continuity for the next turn.

      Stops and returns null (returning ownership to the conversation manager) when:

      • A User message explicitly @-mentions the conversation manager and no non-manager AI message has replied since (e.g. the user said @Sage … and Sage answered directly).
      • An AI message from the conversation manager was handed back from another AI message (ParentID references an AI message, or the immediately preceding row is a non-manager AI message in the same turn).

      Type Parameters

      Parameters

      • messages: readonly T[]
      • conversationManagerAgentId: string | null
      • Optionaloptions: {
            conversationManagerName?: string | null;
            isWithinFloor?: (msg: T) => boolean;
            userMentionsManager?: (msg: T) => boolean;
        }

      Returns T | null