Skip to content

Commit c843917

Browse files
authored
report livekit-cli version to agent server (#686)
1 parent ebe809c commit c843917

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/lk/agent.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"errors"
2020
"fmt"
21+
"net/http"
2122
"os"
2223
"path/filepath"
2324
"regexp"
@@ -29,6 +30,7 @@ import (
2930
"github.com/twitchtv/twirp"
3031
"github.com/urfave/cli/v3"
3132

33+
livekitcli "github.com/livekit/livekit-cli/v2"
3234
"github.com/livekit/livekit-cli/v2/pkg/agentfs"
3335
"github.com/livekit/livekit-cli/v2/pkg/config"
3436
"github.com/livekit/livekit-cli/v2/pkg/util"
@@ -316,7 +318,12 @@ func createAgentClient(ctx context.Context, cmd *cli.Command) (context.Context,
316318
}
317319
}
318320

319-
agentsClient, err = lksdk.NewAgentClient(project.URL, project.APIKey, project.APISecret)
321+
agentsClient, err = lksdk.NewAgentClient(project.URL, project.APIKey, project.APISecret, twirp.WithClientHooks(&twirp.ClientHooks{
322+
RequestPrepared: func(ctx context.Context, req *http.Request) (context.Context, error) {
323+
req.Header.Set("X-LIVEKIT-CLI-VERSION", livekitcli.Version)
324+
return ctx, nil
325+
},
326+
}))
320327
if err != nil {
321328
return ctx, err
322329
}

0 commit comments

Comments
 (0)