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
+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)
}