It looks like `@livekit/agents-js@1.0.23` introduc...
# agents
s
It looks like
@livekit/agents-js@1.0.23
introduced a bug with the new tracing where it is throwing
Error("LIVEKIT_API_KEY and LIVEKIT_API_SECRET must be set for cloud tracing")
when cloud tracing shouldn’t be enabled in a self-hosted environment. This early
return
(source) is not being hit correctly, which is causing
setupCloudTracer
to throw
n
Thank you @tall-belgium-91876 a ton for the quick turn-around with @some-student-89096’s PR yesterday, but it looks like something else was introduced that was crashing our agents out, we had to revert. I think this release will crash for anyone self-hosting
Quick update, Jesse is still investigating but we might have found a way to disable, but it appears to be on by default
s
Ok I figured out what is causing the issue: 1.
AgentSession.start
is defaulting to enabling tracing with
record = true
2.
JobContext.initRecording
has a bug where the
!isCloude(url)
check is not correctly early returning when self-hosting 3. Then
setupCloudTracer
is called, which throws an error if you do not have either
LIVEKIT_API_KEY
or
LIVEKIT_API_SECRET
available in
process.env
, which is another bug since you are supposed to be able to pass in
apiKey
and
apiSecret
via the
ServerOptions
. The
ServerOptions
are not checked properly in this function
🙌 3
👀 1
r
@bitter-ghost-46918 FYI
b
Hey @some-student-89096, thanks for debugging! To clarify a bit:
1.
AgentSession.start
is defaulting to enabling tracing with
record = true
I'll make a quick PR to change the flag.
1.
JobContext.initRecording
has a bug where the
!isCloude(url)
check is not correctly early returning when self-hosting
isCloud
is not supposed to early return once entering
initRecording
with the correct livekit connection URL. The proper way is to not invoking
initRecording
at all when recording is not enabled, which is ^
1. Then
setupCloudTracer
is called, which throws an error if you do not have either
LIVEKIT_API_KEY
or
LIVEKIT_API_SECRET
available in
process.env
, which is another bug since you are supposed to be able to pass in
apiKey
and
apiSecret
via the
ServerOptions
. The
ServerOptions
are not checked properly in this function
This follows python agents design. But I'm happy to make it more JS friendly, and thanks for pointing out the ServerOptions!
We've just released a new version that fix this issue: https://www.npmjs.com/package/@livekit/agents/v/1.0.24. Thanks again for the debugging!
🙌 2
🙌🏼 1
s
isCloud
is not supposed to early return once entering
initRecording
with the correct livekit connection URL. The proper way is to not invoking
initRecording
at all when recording is not enabled, which is ^
Makes sense!
This follows python agents design. But I’m happy to make it more JS friendly, and thanks for pointing out the ServerOptions!
Hmm… this is inconsistent with how all of the other API keys are able to be passed into the plugins and the server.