Skip to content

Add deployment to SimulationRun create for AgentDispatch pinning - #1780

Open
rdysell wants to merge 1 commit into
livekit:mainfrom
rdysell:feat/simulation-run-deployment
Open

Add deployment to SimulationRun create for AgentDispatch pinning#1780
rdysell wants to merge 1 commit into
livekit:mainfrom
rdysell:feat/simulation-run-deployment

Conversation

@rdysell

@rdysell rdysell commented Sep 8, 2026

Copy link
Copy Markdown

Summary

SimulationRun.Create.Request had no deployment field, so Cloud simulations against a live agent (agent_name) could not pin a non-production worker. Omitted CreateAgentDispatchRequest.deployment defaults to production. Projects that share one Cloud agent name across production + staging + dev cannot run staging simulations safely until this field exists and the Cloud simulation service copies it onto AgentDispatch.

Companion CLI: livekit/livekit-cli#965
Tracking: #1778

Docs: Non-production deployments — omit --deployment / empty string = production.

Protocol change

Message Field Notes
SimulationRun.Create.Request string deployment = 14 CLI → create API
SimulationRun string deployment = 23 Persist what the run targeted
SimulationDispatch string deployment = 5 Room metadata; does not select the worker

Empty/unset remains production, matching CreateAgentDispatchRequest.deployment.

Cloud backend (required for the pin)

A proto field the simulation service ignores is not a pin. Please copy Create.Request.deployment onto CreateAgentDispatchRequest.deployment (or equivalent job routing) so the simulated user waits in the same room the pinned worker joins. Rewriting --agent-name plus a separate lk dispatch create --deployment does not work: Cloud simulate waits for the original agent name in its own room.

Codegen

Regenerated with go tool mage proto and protoc 35.1 (same pin as .github/workflows/generate.yaml). JS gen left to the Generate workflow / pnpm --filter @livekit/protocol run generate:proto.

Backwards compatibility

Purely additive. Existing callers that omit deployment keep production dispatch.

Empty/unset stays production, matching CreateAgentDispatchRequest. Cloud
simulations targeting a shared agent name cannot select staging/dev until
this field exists and is copied onto AgentDispatch.

Fixes livekit#1778

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings September 8, 2026 10:51
@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4a663ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
github.com/livekit/protocol Patch
@livekit/protocol Patch

Not sure what this means? Click here to learn what changesets are.

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

@rdysell

rdysell commented Sep 8, 2026

Copy link
Copy Markdown
Author

CLI companion: livekit/livekit-cli#966

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is purely additive at the proto level with consistent regenerated outputs and no detected field-number conflicts or compatibility issues.

Pull request overview

This PR extends the Agent Simulation protocol to support deployment pinning when creating Cloud simulations against a live agent name, enabling safe use of shared agent names across production/staging/dev by propagating the target deployment through simulation run creation and related metadata.

Changes:

  • Add deployment to SimulationRun.Create.Request (request-time selection) and SimulationRun (persisted/returned targeting info).
  • Add deployment to SimulationDispatch (room metadata payload) and regenerate Go protobuf + Twirp outputs.
  • Add a changeset bump for both the Go module and the JS package.
File summaries
File Description
protobufs/livekit_agent_simulation.proto Adds deployment fields with documented semantics (empty/unset = production) across request, persisted run, and dispatch metadata.
livekit/livekit_agent_simulation.pb.go Regenerated Go protobuf bindings reflecting the new fields and accessors.
livekit/livekit_agent_simulation.twirp.go Regenerated Twirp descriptor output consistent with the updated proto.
.changeset/simulation-run-deployment.md Declares patch releases for Go + JS packages and documents the new deployment fields.
Review details

Files not reviewed (2)

  • livekit/livekit_agent_simulation.pb.go: Generated file
  • livekit/livekit_agent_simulation.twirp.go: Generated file
  • Files reviewed: 2/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@CLAassistant

CLAassistant commented Sep 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Rob Dysell seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants