Skip to content

agent_simulation: fix stale comments on how the dispatch and scenario tags reach the agent - #1878

Merged
u9g merged 1 commit into
mainfrom
jason/sim-dispatch-comments
Oct 20, 2026
Merged

u9g merged 1 commit into
mainfrom
jason/sim-dispatch-comments

Conversation

@u9g

@u9g u9g commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

Two comments in protobufs/livekit_agent_simulation.proto describe how simulation data reaches the agent under test, and both describe a transport the simulation pipeline no longer uses. This PR corrects the comments. Nothing on the wire or in the API changes.

Where Before After
SimulationDispatch Carried (protojson-encoded) in the simulation room's metadata so the agent under test can read the scenario + run identity synchronously at connect. Carried (protojson-encoded) in the Job's lk.simulator.dispatch attribute, set on the agent dispatch, so the agent under test can read the scenario + run identity synchronously at job start.
Scenario.tags Set as participant attributes on the simulation participant's access token. Surfaced to the agent under test as SimulationContext scenario tags.

How the dispatch actually travels

  • Writer. The simulation worker in LiveKit Cloud protojson-encodes the SimulationDispatch and puts it, with the lk.simulator marker, in the attributes of the RoomAgentDispatch it passes to CreateRoom. The server delivers those attributes on the Job. The simulator participant's token carries only lk.simulator: true; scenario tags are not on it. Source (private repo): dispatch attributes on CreateRoom, the room creation, the simulator token.
  • Python reader. JobContext.simulation_context() parses job.attributes["lk.simulator.dispatch"]: livekit/agents job.py, the attribute key.
  • Node reader. JobContext.simulationContext() parses the same job attribute: livekit/agents-js job.ts, the attribute key.
  • Tags. The tags only travel inside the dispatch's scenario, which both SDKs expose as SimulationContext.scenario.

The SimulationDispatch comment was written with the message in #1609. The dispatch has moved twice since: to a simulator participant attribute (livekit/agents-private#85), then to the agent dispatch attributes (livekit/agents-private#179, read by livekit/agents#6089 and livekit/agents-js#2075). The worker stopped copying scenario tags onto the simulator's token in the first of those moves. Neither comment was updated.

Notes

… tags reach the agent

SimulationDispatch is carried in the lk.simulator.dispatch attribute of the
agent dispatch, which lands on the Job; it is not in the room metadata.
Scenario tags travel inside that dispatch and are no longer copied onto the
simulator participant's access token.

Comment-only. livekit_agent_simulation.pb.go is regenerated with the pinned
tooling (go tool mage proto, protoc 35.1).
@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7209345

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@u9g
u9g merged commit d5d1282 into main Oct 20, 2026
8 checks passed
@u9g
u9g deleted the jason/sim-dispatch-comments branch October 20, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants