Skip to content

feat: add deployment field to agent dispatch#968

Merged
xianshijing-lk merged 1 commit into
mainfrom
shijing/agent-deployment
Jun 17, 2026
Merged

feat: add deployment field to agent dispatch#968
xianshijing-lk merged 1 commit into
mainfrom
shijing/agent-deployment

Conversation

@xianshijing-lk

@xianshijing-lk xianshijing-lk commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add deployment field to RoomAgentDispatch for targeting specific agent deployments
  • Add agentDeployment to TokenRequestOptions to pass deployment through token requests

The deployment field allows targeting a specific agent deployment (e.g., "staging"). Leave empty to target the production deployment.

Related PRs:

Usage

val options = TokenRequestOptions(
    roomName = "my-room",
    agentName = "my-agent",
    agentDeployment = "staging"  // Optional: target specific deployment
)

Or directly via RoomAgentDispatch:

val dispatch = RoomAgentDispatch(
    agentName = "my-agent",
    metadata = "my-metadata",
    deployment = "staging"
)

Test plan

Unit Tests

./gradlew :livekit-android-test:test --tests "*TokenSourceTest*"
./gradlew test

Manual Verification

1. Verify JSON serialization includes deployment:

val dispatch = RoomAgentDispatch(
    agentName = "my-agent",
    deployment = "staging"
)
val json = Json.encodeToString(dispatch)
println(json)  // Should include "deployment": "staging"

2. Verify TokenRequestOptions converts to request correctly:

val options = TokenRequestOptions(
    roomName = "test-room",
    agentName = "my-agent",
    agentDeployment = "staging"
)
val request = options.toRequest()
println(request.roomConfig?.agents?.firstOrNull()?.deployment)  // Should print "staging"

3. Verify JSON round-trip:

val original = RoomAgentDispatch(
    agentName = "my-agent",
    deployment = "staging"
)
val json = Json.encodeToString(original)
val restored = Json.decodeFromString<RoomAgentDispatch>(json)
assert(restored.deployment == "staging")

End-to-End Verification

  1. Use TokenSource to get credentials with agentDeployment set
  2. Connect to room - agent with matching deployment should join
  3. Verify only staging agent receives the dispatch

🤖 Generated with Claude Code

Add `deployment` field to `RoomAgentDispatch` and `agentDeployment`
to `TokenRequestOptions` for targeting specific agent deployments.
Leave empty to target the production deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bb4bd03

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

@github-actions

Copy link
Copy Markdown
Contributor

Diffuse output:

Base AAR cache miss. Please run the build job on main to generate the base AAR.

@xianshijing-lk xianshijing-lk merged commit 677433b into main Jun 17, 2026
7 checks passed
@xianshijing-lk xianshijing-lk deleted the shijing/agent-deployment branch June 17, 2026 09:39
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