some-student-89096
12/03/2025, 6:55 PM@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 thrownumerous-easter-60982
12/03/2025, 6:59 PMnumerous-easter-60982
12/03/2025, 7:12 PMsome-student-89096
12/03/2025, 7:17 PMAgentSession.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 functionrefined-appointment-81829
12/03/2025, 9:13 PMbitter-ghost-46918
12/04/2025, 6:20 AM1.I'll make a quick PR to change the flag.is defaulting to enabling tracing withAgentSession.startrecord = true
1.has a bug where theJobContext.initRecordingcheck is not correctly early returning when self-hosting!isCloude(url)
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. ThenThis follows python agents design. But I'm happy to make it more JS friendly, and thanks for pointing out the ServerOptions!is called, which throws an error if you do not have eithersetupCloudTracerorLIVEKIT_API_KEYavailable inLIVEKIT_API_SECRET, which is another bug since you are supposed to be able to pass inprocess.envandapiKeyvia theapiSecret. TheServerOptionsare not checked properly in this functionServerOptions
bitter-ghost-46918
12/04/2025, 6:46 AMsome-student-89096
12/04/2025, 5:43 PMMakes sense!is not supposed to early return once enteringisCloudwith the correct livekit connection URL. The proper way is to not invokinginitRecordingat all when recording is not enabled, which is ^initRecording
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.