Member Junction
    Preparing search index...

    Function ResolveRealtimeCoAgentID

    • Resolves the co-agent (the Realtime-type agent that voices the target agent) via the metadata-driven co-agent resolution chain — first match wins:

      1. Explicit — explicitCoAgentID. A per-call override; an invalid candidate throws (the caller asked for something specific, so there is no silent fallback).
      2. Per-agent persona — the target agent's DefaultCoAgentID. An invalid reference logs and falls through (stale metadata must degrade, never break live calls).
      3. Per-type default — an Active AIAgentCoAgent row of Type 'CoAgent' whose TargetAgentTypeID is the target's type (IsDefault first, then lowest Sequence). Same tolerant semantics as step 2.
      4. Global default — the seeded REALTIME_CO_AGENT_NAME agent (with a deprecated fallback to LEGACY_REALTIME_CO_AGENT_NAME). Throws when absent: realtime is unconfigured in this deployment.

      Every candidate from steps 1–3 must exist, be Active, and be of the REALTIME_AGENT_TYPE_NAME type.

      Parameters

      • targetAgentID: string

        The agent the co-agent will voice (drives steps 2–3).

      • explicitCoAgentID: string

        The explicit co-agent choice, when supplied (step 1).

      • contextUser: UserInfo

        The user the metadata reads run as.

      • provider: IMetadataProvider

        The request-scoped metadata provider.

      Returns Promise<string>

      The resolved co-agent's id (canonical casing from the metadata cache).

      When an explicit candidate is invalid, or no co-agent is configured at all.