# Function findActiveSession

- findActiveSession(
  sessionMetrics: Iterable<ObserverSessionMetrics>,
  ): ObserverSessionMetrics | undefined

  Finds the first active session (no completedAt) from metrics.

  #### Parameters

  - sessionMetrics: Iterable<ObserverSessionMetrics>

    Iterable of session metrics

  #### Returns ObserverSessionMetrics | undefined

  The first active session or undefined

  - Defined in packages/nexus-agents/src/agents/observability/orchestration-observer-helpers.ts:230