CoAgent8 - Source API
    Preparing search index...

    Function selectSmartQuotaBackend

    • Selects an installed permitted provider using cooldowns and cached headroom.

      Parameters

      • candidates: ("codex" | "claude" | "agy")[] | null = null

        Stable tie-break order; defaults to the provider registry.

      • options: AvailabilitySelectionOptions = {}

        Configuration, probes, quota report and optional caller identity.

      Returns Promise<"codex" | "claude" | "agy">

      An eligible different CLI when possible, otherwise the caller's own provider.

      When no provider is executable or all eligible providers have observed limits. A quota cache that cannot be updated adds a warning to options.warnings instead.

      Measured headroom sorts descending; unknown quota uses 50 as a ranking heuristic, not account telemetry. A measurement older than QUOTA_MEASUREMENT_MAX_AGE_MS counts as unknown.