Participant kind agent details (#4809)

* Carry worker kind details into agent job tokens.

WorkerRegistration gains a server-controlled KindDetails field that is
passed to BuildAgentToken when assigning jobs, so kind details flow into
the participant join token for the whole session.

Co-authored-by: Cursor <cursoragent@cursor.com>

Signed-off-by: shishir gowda <shishir@livekit.io>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
shishirng
2026-08-28 08:02:17 -04:00
committed by GitHub
co-authored by Cursor
parent d185224719
commit a1be640b12
3 changed files with 89 additions and 82 deletions
+7
View File
@@ -155,6 +155,12 @@ type WorkerRegistration struct {
Permissions *livekit.ParticipantPermission
ClientIP string
Deployment string
// KindDetails, when set by the server, are stamped onto the participant
// join token minted for every job assigned to this worker (e.g. marking
// hosted/cloud agents so they can be distinguished from self-hosted ones in
// observability). This is server-controlled and never populated from the
// worker's register request.
KindDetails []livekit.ParticipantInfo_KindDetail
}
func MakeWorkerRegistration() WorkerRegistration {
@@ -398,6 +404,7 @@ func (w *Worker) AssignJob(ctx context.Context, job *livekit.Job, hook Assignmen
res.ParticipantMetadata,
attributes,
w.Permissions,
w.KindDetails...,
)
if err != nil {
w.logger.Errorw("failed to build agent token", err)