Skip to content

LiveKit Agents 1.3 JobContext.api credentials regressionΒ #4072

@inickt

Description

@inickt

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 @ cefeaa7e7e2f1f6f5308b60ae461357a6b45ceec

Session/Room/Call IDs

No response

Proposed Solution

  1. Update documentation here (still would be a regression)
  2. Update AgentServer to export env variables (like before)
  3. Update JobContext to actually use the LiveKit API from AgentServer

(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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions