agent: thread attributes map from dispatch to job (#4598)

* agent: thread simulation flag from dispatch to job

Reads simulation from AgentDispatch / RoomAgentDispatch and copies it
onto Job in agent.LaunchJob and the inline room-agent path so workers
see the flag.

Stacked on top of livekit/protocol#1629.

* agent: replace simulation bool with attributes map

Threads the renamed attributes map (was bool simulation) from dispatch
to job and bumps the protocol pseudo-version.

* deps
This commit is contained in:
Paul Wells
2026-06-16 01:53:01 -07:00
committed by GitHub
parent 1f3e06107b
commit 12a023ae45
5 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ require (
github.com/jxskiss/base62 v1.1.0
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731
github.com/livekit/mediatransportutil v0.0.0-20260608063931-a3417d38cda0
github.com/livekit/protocol v1.46.7-0.20260611165352-04a0fe5b5051
github.com/livekit/protocol v1.46.9-0.20260616084954-6bd536c5c6d4
github.com/livekit/psrpc v0.7.2
github.com/mackerelio/go-osstat v0.2.7
github.com/magefile/mage v1.17.2
+2 -2
View File
@@ -160,8 +160,8 @@ github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731 h1:9x+U2HGLrSw5AT
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
github.com/livekit/mediatransportutil v0.0.0-20260608063931-a3417d38cda0 h1:XHNNzebIKZRkLimla/hFGrAIX5EMWHctrgt3hLw7s+I=
github.com/livekit/mediatransportutil v0.0.0-20260608063931-a3417d38cda0/go.mod h1:o8CFmAdrVwzJNOCsQCLUzXRjokkufNshnQHOe4fRaqU=
github.com/livekit/protocol v1.46.7-0.20260611165352-04a0fe5b5051 h1:IYqiW7z5pblZBn6o0OHNz8MHd3wJ/TLJG4gh6lCI0/s=
github.com/livekit/protocol v1.46.7-0.20260611165352-04a0fe5b5051/go.mod h1:jO+y05AU9Ec4JswDyuzKCZ4bhziOS0CzMqgnbj60Dzs=
github.com/livekit/protocol v1.46.9-0.20260616084954-6bd536c5c6d4 h1:5YChJaYTXdVsz7zIZ12vOY2ToLVq3Bzs8xZxmv5SA+0=
github.com/livekit/protocol v1.46.9-0.20260616084954-6bd536c5c6d4/go.mod h1:jO+y05AU9Ec4JswDyuzKCZ4bhziOS0CzMqgnbj60Dzs=
github.com/livekit/psrpc v0.7.2 h1:6oZ+NODJ2pLyaT6VqDq1F4Qc/3TpDUSpyphj/P9MhQc=
github.com/livekit/psrpc v0.7.2/go.mod h1:rAI+m2+/cb4x9RXhLRtUx5ZwdfjjXOl4zi46IjEetaw=
github.com/mackerelio/go-osstat v0.2.7 h1:TCavZi10wF49bT6iQZ9eT2keGZQpC69MTDfdJej5e94=
+2
View File
@@ -64,6 +64,7 @@ type JobRequest struct {
Metadata string
AgentName string
Deployment string
Attributes map[string]string
}
type agentClient struct {
@@ -172,6 +173,7 @@ func (c *agentClient) LaunchJob(ctx context.Context, desc *JobRequest) *serverut
Metadata: desc.Metadata,
EnableRecording: c.config.EnableUserDataRecording,
Deployment: desc.Deployment,
Attributes: desc.Attributes,
}
resp, err := c.client.JobRequest(context.Background(), topic, jobTypeTopic, job)
if err != nil {
+3
View File
@@ -1779,6 +1779,7 @@ func (r *Room) launchRoomAgents(ads []*agentDispatch) {
AgentName: ad.AgentName,
DispatchId: ad.Id,
Deployment: ad.Deployment,
Attributes: ad.Attributes,
})
r.handleNewJobs(ad.AgentDispatch, inc)
done()
@@ -1803,6 +1804,7 @@ func (r *Room) launchTargetAgents(ads []*agentDispatch, p types.Participant, job
AgentName: ad.AgentName,
DispatchId: ad.Id,
Deployment: ad.Deployment,
Attributes: ad.Attributes,
})
r.handleNewJobs(ad.AgentDispatch, inc)
done()
@@ -1869,6 +1871,7 @@ func (r *Room) createAgentDispatchFromRoomDispatch(rad *livekit.RoomAgentDispatc
Room: r.protoRoom.Name,
RestartPolicy: rad.GetRestartPolicy(),
Deployment: rad.GetDeployment(),
Attributes: rad.GetAttributes(),
})
}
+1
View File
@@ -79,6 +79,7 @@ func (ag *AgentDispatchService) CreateDispatch(ctx context.Context, req *livekit
Metadata: req.Metadata,
RestartPolicy: req.RestartPolicy,
Deployment: req.Deployment,
Attributes: req.Attributes,
}
return ag.agentDispatchClient.CreateDispatch(ctx, ag.topicFormatter.RoomTopic(ctx, livekit.RoomName(req.Room)), dispatch)
}