-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Bug Description
After updating to 1.3.3 (locally, since this also needs #4046 until a new release is published), JobContext.api no longer works with credentials that are loaded at runtime in WorkerOptions (or AgentServer).
These environment variables used to be exported if they were set at runtime: #3581
Expected Behavior
ctx.api should reuse the same credentials set in WorkerOptions/ServerOptions/AgentServer
Reproduction Steps
1. Set `ws_url`/`api_key`/`api_secret` in code, whether through legacy `WorkerOptions` or new `AgentServer`
2. Access `ctx.api`Operating System
macOS / linux
Models Used
n/a
Package Versions
1.3.3 @ cefeaa7e7e2f1f6f5308b60ae461357a6b45ceecSession/Room/Call IDs
No response
Proposed Solution
- Update documentation here (still would be a regression)
- Update
AgentServerto export env variables (like before) - Update
JobContextto actually use the LiveKit API fromAgentServer
(3) seems ideal to me if the API session is able to be reused, otherwise (2) is fine. If you deem this a mistake it is pretty easy for us to fix (1) in code ourselves, but it is a tiny regression so wanted to flag.
Additional Context
We have a more complicated server startup with config loading so we have a bit more indirection that normal where we want our own config loader and to explicitly pass in creds vs assuming the environment variable are always set.
Thanks!
Screenshots and Recordings
No response