Skip to content

Commit 655e089

Browse files
committed
fix(agents): set sbx id in envrionment when initializing agent
1 parent 74fd243 commit 655e089

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/lk/agent.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@ func initAgent(ctx context.Context, cmd *cli.Command) error {
410410
if appName == "" {
411411
appName = project.Name
412412
}
413-
// We set agent name in env for use in template tasks
414-
os.Setenv("LIVEKIT_AGENT_NAME", appName)
415413

416414
// TODO: (@rektdeckard) figure out why AccessKeyProvider does not immediately
417415
// have access to newly-created API keys, then remove this sleep
@@ -424,6 +422,11 @@ func initAgent(ctx context.Context, cmd *cli.Command) error {
424422
token,
425423
serverURL,
426424
)
425+
426+
// We set agent name and sandbox ID in env for use in template tasks
427+
os.Setenv("LIVEKIT_AGENT_NAME", appName)
428+
os.Setenv("LIVEKIT_SANDBOX_ID", sandboxID)
429+
427430
return err
428431
}); err != nil {
429432
return fmt.Errorf("failed to create sandbox: %w", err)

0 commit comments

Comments
 (0)