Prewarm LLM provider connections - #2106
Conversation
🦋 Changeset detectedLatest commit: 795981e The changes in this PR will be included in the next version bump. This PR includes changesets to release 39 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Prewarm resolved agent-level models and guard close races, with deterministic lifecycle and provider-boundary coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise the installed SDK through token and network boundaries so auth ordering and cancellation cannot be hidden by a full-client mock. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Completed Rosetta parity and verification at exact head The resolved branch adds the missing agent-level activity prewarm path, close-race protection, deterministic base/provider coverage including real-SDK Vertex auth, and fresh Cue voice evidence |
Summary
Python parity
Compared against livekit/agents#6484 and the current Python implementation. JS now matches Python's session-level and activity-level prewarm lifecycle, including
Agent.llmoverrides, one-shot best-effort behavior, and provider model-list requests.RealtimeModelis excluded from the non-realtime hook, and FallbackAdapter remains intentionally unsupported as in Python.The JS close lifecycle additionally aborts and awaits in-flight prewarm work and blocks starts after close.
Tests
pnpm typecheckandpnpm build— passedgit diff --check— cleanSpec compliance: APPROVEDandCode quality: APPROVED, no findingsAPI Extractor remains blocked only by documented base-branch namespace-export/missing-baseline issues; declaration builds pass and no new prewarm API warning is introduced.
Cue voice evidence
Fresh exact-head session:
sid_915c77d73b3cThe agent-level LLM is distinct from the session LLM and sends a controlled models-list-compatible request to an in-process HTTP boundary. Persisted framework evidence proves:
795981ec09298f80618a0b4e035ade1228c9d97dprewarm_request,chatagent-prewarm-once-before-chatThe controlled endpoint proves framework ordering/count and lifecycle dispatch; it does not claim production-provider latency magnitude or TLS reuse.
Ported from livekit/agents#6484